From 6857286b421aafcec79bbd9c0321e8d988ab09e8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Jul 2022 16:18:31 +0200 Subject: [PATCH] decoder/Thread: don't scan for replay gain tags in PCM streams This disables a long delay for playing songs from the cdio_paranoia input plugin if ReplayGain is enabled. --- NEWS | 1 + src/decoder/Thread.cxx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 89bda0ed6..c9f5e3919 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.23.8 (not yet released) * input - cdio_paranoia: fix crash if no drive was found - cdio_paranoia: faster cancellation + - cdio_paranoia: don't scan for replay gain tags * output - pipewire: fix crash with PipeWire 0.3.53 * mixer diff --git a/src/decoder/Thread.cxx b/src/decoder/Thread.cxx index 4432c6605..c9635e70b 100644 --- a/src/decoder/Thread.cxx +++ b/src/decoder/Thread.cxx @@ -36,6 +36,7 @@ #include "util/RuntimeError.hxx" #include "util/Domain.hxx" #include "util/ScopeExit.hxx" +#include "util/StringCompare.hxx" #include "thread/Name.hxx" #include "tag/ApeReplayGain.hxx" #include "Log.hxx" @@ -265,6 +266,13 @@ MaybeLoadReplayGain(DecoderBridge &bridge, InputStream &is) /* ReplayGain is disabled */ return; + if (is.HasMimeType() && + StringStartsWith(is.GetMimeType(), "audio/x-mpd-")) + /* skip for (virtual) files (e.g. from the + cdio_paranoia input plugin) which cannot possibly + contain tags */ + return; + LoadReplayGain(bridge, is); }