Commit b111a8fe authored by cathugger's avatar cathugger Committed by Max Kellermann

output/Thread: ensure pending tags are flushed in all cases

Fixes hanging playback with soxr resampler. Closes #139, #141
parent 3b23cf02
...@@ -5,6 +5,8 @@ ver 0.20.12 (not yet released) ...@@ -5,6 +5,8 @@ ver 0.20.12 (not yet released)
- vorbis: fix Tremor support - vorbis: fix Tremor support
* player * player
- log message when decoder is too slow - log message when decoder is too slow
* output
- fix hanging playback with soxr resampler
ver 0.20.11 (2017/10/18) ver 0.20.11 (2017/10/18)
* storage * storage
......
...@@ -271,16 +271,15 @@ try { ...@@ -271,16 +271,15 @@ try {
inline bool inline bool
AudioOutput::PlayChunk() AudioOutput::PlayChunk()
{ {
if (tags) { // ensure pending tags are flushed in all cases
const auto *tag = source.ReadTag(); const auto *tag = source.ReadTag();
if (tag != nullptr) { if (tags && tag != nullptr) {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
try { try {
ao_plugin_send_tag(this, *tag); ao_plugin_send_tag(this, *tag);
} catch (const std::runtime_error &e) { } catch (const std::runtime_error &e) {
FormatError(e, "Failed to send tag to \"%s\" [%s]", FormatError(e, "Failed to send tag to \"%s\" [%s]",
name, plugin.name); name, plugin.name);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment