output/Thread: add assertion on the ao_plugin_play() result

This commit is contained in:
Max Kellermann 2017-02-10 22:24:36 +01:00
parent 4a80e9cb25
commit 835136dcd3

View File

@ -297,6 +297,7 @@ AudioOutput::PlayChunk()
try { try {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
nbytes = ao_plugin_play(*this, data.data, data.size); nbytes = ao_plugin_play(*this, data.data, data.size);
assert(nbytes <= data.size);
} catch (const std::runtime_error &e) { } catch (const std::runtime_error &e) {
FormatError(e, "\"%s\" [%s] failed to play", FormatError(e, "\"%s\" [%s] failed to play",
name, plugin.name); name, plugin.name);