summaryrefslogtreecommitdiff
path: root/src/output/Thread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/Thread.cxx')
-rw-r--r--src/output/Thread.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index 5acf0da0b..ed2feac82 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -245,16 +245,15 @@ try {
inline bool
AudioOutputControl::PlayChunk() noexcept
{
- if (tags) {
- const auto *tag = source.ReadTag();
- if (tag != nullptr) {
- const ScopeUnlock unlock(mutex);
- try {
- output->SendTag(*tag);
- } catch (const std::runtime_error &e) {
- FormatError(e, "Failed to send tag to %s",
- GetLogName());
- }
+ // ensure pending tags are flushed in all cases
+ const auto *tag = source.ReadTag();
+ if (tags && tag != nullptr) {
+ const ScopeUnlock unlock(mutex);
+ try {
+ output->SendTag(*tag);
+ } catch (const std::runtime_error &e) {
+ FormatError(e, "Failed to send tag to %s",
+ GetLogName());
}
}