From 7361247c1b346b0b862184ca6cb04222c389d608 Mon Sep 17 00:00:00 2001 From: NP v/d Spek <github_mail@lumensoft.nl> Date: Fri, 25 Oct 2024 21:12:11 +0200 Subject: [PATCH] make sure that only the component locking is in place. --- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp b/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp index 2fc0f6b194..f1ec97150c 100644 --- a/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +++ b/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp @@ -242,9 +242,8 @@ void I2SAudioSpeaker::speaker_task(void *params) { pdFALSE, // Don't wait for all the bits, portMAX_DELAY); // Block indefinitely until a bit is set - if (event_group_bits & (SpeakerEventGroupBits::COMMAND_STOP | - SpeakerEventGroupBits::COMMAND_STOP_GRACEFULLY)) { // Received a stop signal before the task - // was requested to start + if (event_group_bits & (SpeakerEventGroupBits::COMMAND_STOP | SpeakerEventGroupBits::COMMAND_STOP_GRACEFULLY)) { + // Received a stop signal before the task was requested to start this_speaker->delete_task_(0); }