decoder/Thread: move check to SongHasVolatileTags()

This commit is contained in:
Max Kellermann 2018-10-24 16:32:41 +02:00
parent 30e22b753b
commit 426bde3f75

View File

@ -431,6 +431,19 @@ try {
error_uri)); error_uri));
} }
/**
* Try to guess whether tags attached to the given song are
* "volatile", e.g. if they have been received by a live stream, but
* are only kept as a cache to be displayed by the client; they shall
* not be sent to the output.
*/
gcc_pure
static bool
SongHasVolatileTags(const DetachedSong &song) noexcept
{
return !song.IsFile();
}
/** /**
* Decode a song addressed by a #DetachedSong. * Decode a song addressed by a #DetachedSong.
* *
@ -446,7 +459,7 @@ decoder_run_song(DecoderControl &dc,
file - tags on "stream" songs are just file - tags on "stream" songs are just
remembered from the last time we remembered from the last time we
played it*/ played it*/
song.IsFile() ? std::make_unique<Tag>(song.GetTag()) : nullptr); !SongHasVolatileTags(song) ? std::make_unique<Tag>(song.GetTag()) : nullptr);
dc.state = DecoderState::START; dc.state = DecoderState::START;
dc.CommandFinishedLocked(); dc.CommandFinishedLocked();