From 3297900543a54ae2414f161fe0a5a8261f7d9fb1 Mon Sep 17 00:00:00 2001 From: Dwedit Date: Fri, 23 Mar 2018 17:22:00 -0500 Subject: [PATCH] Add the early return to audio_driver_sample_batch --- audio/audio_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/audio/audio_driver.c b/audio/audio_driver.c index a5643ed4f8..74824deff1 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -728,6 +728,9 @@ size_t audio_driver_sample_batch(const int16_t *data, size_t frames) if (frames > (AUDIO_CHUNK_SIZE_NONBLOCKING >> 1)) frames = AUDIO_CHUNK_SIZE_NONBLOCKING >> 1; + if (audio_suspended) + return frames; + audio_driver_flush(data, frames << 1); return frames;