diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-04-19 13:00:42 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-04-19 13:00:42 +1000 |
| commit | 561f9d2a07ee6ee1c2f18dc375125f87ea7b0d55 (patch) | |
| tree | e55d86fa2a44b501ab2f190916b5cd9b207fd606 /src/audio/audio_task.cpp | |
| parent | 25c5896dc5c239e3a175c6c8fc5d7368946adeb6 (diff) | |
| download | tangara-fw-561f9d2a07ee6ee1c2f18dc375125f87ea7b0d55.tar.gz | |
Ensure the sink buffer is large enough to not fully drain during
playback
Diffstat (limited to 'src/audio/audio_task.cpp')
| -rw-r--r-- | src/audio/audio_task.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/audio/audio_task.cpp b/src/audio/audio_task.cpp index 464879d8..3a2a5941 100644 --- a/src/audio/audio_task.cpp +++ b/src/audio/audio_task.cpp @@ -124,7 +124,7 @@ void AudioTaskMain(void* args) { RawStream raw_sink_stream = elements.front()->OutStream(&out_region); InputStream sink_stream(&raw_sink_stream); - if (sink_stream.data().size_bytes() == 0) { + if (sink_stream.info().bytes_in_stream == 0) { out_region.Unmap(); vTaskDelay(pdMS_TO_TICKS(100)); continue; @@ -143,7 +143,8 @@ void AudioTaskMain(void* args) { // We've reconfigured the sink, or it was already configured correctly. // Send through some data. - if (output_format == sink_stream.info().format && !std::holds_alternative<std::monostate>(*output_format)) { + if (output_format == sink_stream.info().format && + !std::holds_alternative<std::monostate>(*output_format)) { // TODO: tune the delay on this, as it's currently the only way to // throttle this task's CPU time. Maybe also hold off on the pipeline // if the buffer is already close to full? @@ -160,7 +161,7 @@ void AudioTaskMain(void* args) { vTaskDelete(NULL); } -static std::byte sDrainBuf[1024]; +static std::byte sDrainBuf[8 * 1024]; void AudioDrainMain(void* args) { { |
