From 79839db3a3b6819eb4d4d8408bc368bf1bc2618e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 17 Jun 2019 21:04:52 +0200 Subject: [PATCH] output/oss: return early if PcmExport::Export() returns empty array This can happen if the DoP converter doesn't get enough source samples for one destination quad. This isn't a critical bug, because the OSS plugin doesn't support DoP yet, but it's good to be prepared. --- src/output/plugins/OssOutputPlugin.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index 26e8ff2a9..77ec21bed 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -670,12 +670,13 @@ OssOutput::Play(const void *chunk, size_t size) #ifdef AFMT_S24_PACKED const auto e = pcm_export->Export({chunk, size}); + if (e.empty()) + return size; + chunk = e.data; size = e.size; #endif - assert(size > 0); - while (true) { ret = fd.Write(chunk, size); if (ret > 0) {