mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 03:42:20 +01:00
[speaker] ensure the pipeline returns an error state before returning its stopped (#8878)
This commit is contained in:
committed by
Jesse Hills
parent
90e3c5bba2
commit
e4f3a952d5
@@ -174,6 +174,16 @@ AudioPipelineState AudioPipeline::process_state() {
|
||||
}
|
||||
}
|
||||
|
||||
if ((event_bits & EventGroupBits::READER_MESSAGE_ERROR)) {
|
||||
xEventGroupClearBits(this->event_group_, EventGroupBits::READER_MESSAGE_ERROR);
|
||||
return AudioPipelineState::ERROR_READING;
|
||||
}
|
||||
|
||||
if ((event_bits & EventGroupBits::DECODER_MESSAGE_ERROR)) {
|
||||
xEventGroupClearBits(this->event_group_, EventGroupBits::DECODER_MESSAGE_ERROR);
|
||||
return AudioPipelineState::ERROR_DECODING;
|
||||
}
|
||||
|
||||
if ((event_bits & EventGroupBits::READER_MESSAGE_FINISHED) &&
|
||||
(!(event_bits & EventGroupBits::READER_MESSAGE_LOADED_MEDIA_TYPE) &&
|
||||
(event_bits & EventGroupBits::DECODER_MESSAGE_FINISHED))) {
|
||||
@@ -203,16 +213,6 @@ AudioPipelineState AudioPipeline::process_state() {
|
||||
return AudioPipelineState::STOPPED;
|
||||
}
|
||||
|
||||
if ((event_bits & EventGroupBits::READER_MESSAGE_ERROR)) {
|
||||
xEventGroupClearBits(this->event_group_, EventGroupBits::READER_MESSAGE_ERROR);
|
||||
return AudioPipelineState::ERROR_READING;
|
||||
}
|
||||
|
||||
if ((event_bits & EventGroupBits::DECODER_MESSAGE_ERROR)) {
|
||||
xEventGroupClearBits(this->event_group_, EventGroupBits::DECODER_MESSAGE_ERROR);
|
||||
return AudioPipelineState::ERROR_DECODING;
|
||||
}
|
||||
|
||||
if (this->pause_state_) {
|
||||
return AudioPipelineState::PAUSED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user