diff options
author | cathugger <cathugger@cock.li> | 2017-11-04 03:38:49 +0000 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-11-05 17:42:32 +0100 |
commit | b111a8fe8d64ee9584ffc63f648dc1bce7c670d6 (patch) | |
tree | 6dbd8fbe4edd51273ed1a9f6e7eb5fcab9094b65 /src | |
parent | 3b23cf0258e4225d094e10d16fcdc95b10d49d84 (diff) |
output/Thread: ensure pending tags are flushed in all cases
Fixes hanging playback with soxr resampler.
Closes #139, #141
Diffstat (limited to 'src')
-rw-r--r-- | src/output/OutputThread.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index c2ee2ccfc..d3f9c2bb8 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -271,16 +271,15 @@ try { inline bool AudioOutput::PlayChunk() { - if (tags) { - const auto *tag = source.ReadTag(); - if (tag != nullptr) { - const ScopeUnlock unlock(mutex); - try { - ao_plugin_send_tag(this, *tag); - } catch (const std::runtime_error &e) { - FormatError(e, "Failed to send tag to \"%s\" [%s]", - name, plugin.name); - } + // ensure pending tags are flushed in all cases + const auto *tag = source.ReadTag(); + if (tags && tag != nullptr) { + const ScopeUnlock unlock(mutex); + try { + ao_plugin_send_tag(this, *tag); + } catch (const std::runtime_error &e) { + FormatError(e, "Failed to send tag to \"%s\" [%s]", + name, plugin.name); } } |