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.
This commit is contained in:
Max Kellermann 2019-06-17 21:04:52 +02:00
parent d478bdda8e
commit 79839db3a3
1 changed files with 3 additions and 2 deletions

View File

@ -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) {