mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
[speaker] ensure the pipeline returns an error state before returning its stopped (#8878)
This commit is contained in:
parent
c23ea384fb
commit
e95c92773c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user