diff --git a/esphome/components/speaker/media_player/audio_pipeline.cpp b/esphome/components/speaker/media_player/audio_pipeline.cpp index b49cf3ddda..60f562cc2c 100644 --- a/esphome/components/speaker/media_player/audio_pipeline.cpp +++ b/esphome/components/speaker/media_player/audio_pipeline.cpp @@ -441,9 +441,10 @@ void AudioPipeline::decode_task(void *params) { pdFALSE, // Wait for all the bits, portMAX_DELAY); // Block indefinitely until bit is set + xEventGroupClearBits(this_pipeline->event_group_, + EventGroupBits::DECODER_MESSAGE_FINISHED | EventGroupBits::READER_MESSAGE_LOADED_MEDIA_TYPE); + if (!(event_bits & EventGroupBits::PIPELINE_COMMAND_STOP)) { - xEventGroupClearBits(this_pipeline->event_group_, - EventGroupBits::DECODER_MESSAGE_FINISHED | EventGroupBits::READER_MESSAGE_LOADED_MEDIA_TYPE); InfoErrorEvent event; event.source = InfoErrorSource::DECODER;