mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
[speaker] bugfix: continue to block tasks if stop flag is set (#9222)
This commit is contained in:
parent
e146c0796a
commit
068aa0ff1e
@ -343,10 +343,9 @@ void AudioPipeline::read_task(void *params) {
|
||||
xEventGroupSetBits(this_pipeline->event_group_, EventGroupBits::READER_MESSAGE_FINISHED);
|
||||
|
||||
// Wait until the pipeline notifies us the source of the media file
|
||||
EventBits_t event_bits =
|
||||
xEventGroupWaitBits(this_pipeline->event_group_,
|
||||
EventGroupBits::READER_COMMAND_INIT_FILE | EventGroupBits::READER_COMMAND_INIT_HTTP |
|
||||
EventGroupBits::PIPELINE_COMMAND_STOP, // Bit message to read
|
||||
EventBits_t event_bits = xEventGroupWaitBits(
|
||||
this_pipeline->event_group_,
|
||||
EventGroupBits::READER_COMMAND_INIT_FILE | EventGroupBits::READER_COMMAND_INIT_HTTP, // Bit message to read
|
||||
pdFALSE, // Clear the bit on exit
|
||||
pdFALSE, // Wait for all the bits,
|
||||
portMAX_DELAY); // Block indefinitely until bit is set
|
||||
@ -434,9 +433,9 @@ void AudioPipeline::decode_task(void *params) {
|
||||
xEventGroupSetBits(this_pipeline->event_group_, EventGroupBits::DECODER_MESSAGE_FINISHED);
|
||||
|
||||
// Wait until the reader notifies us that the media type is available
|
||||
EventBits_t event_bits = xEventGroupWaitBits(this_pipeline->event_group_,
|
||||
EventGroupBits::READER_MESSAGE_LOADED_MEDIA_TYPE |
|
||||
EventGroupBits::PIPELINE_COMMAND_STOP, // Bit message to read
|
||||
EventBits_t event_bits =
|
||||
xEventGroupWaitBits(this_pipeline->event_group_,
|
||||
EventGroupBits::READER_MESSAGE_LOADED_MEDIA_TYPE, // Bit message to read
|
||||
pdFALSE, // Clear the bit on exit
|
||||
pdFALSE, // Wait for all the bits,
|
||||
portMAX_DELAY); // Block indefinitely until bit is set
|
||||
|
Loading…
x
Reference in New Issue
Block a user