diff options
author | Max Kellermann <max@duempel.org> | 2015-06-21 15:02:14 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-06-21 15:02:14 +0200 |
commit | 9acefcb256347ac252db3ea61be2e047d32c0a51 (patch) | |
tree | d3ad7084e2693130739a05f58c6879595032db22 /src/decoder/DecoderThread.cxx | |
parent | e4d0293a31f30c01142202ee433cd28115b73343 (diff) | |
download | mpd-9acefcb256347ac252db3ea61be2e047d32c0a51.tar.gz mpd-9acefcb256347ac252db3ea61be2e047d32c0a51.tar.xz mpd-9acefcb256347ac252db3ea61be2e047d32c0a51.zip |
DecoderThread: set Decoder::song_tag only for local files
If the song tag comes from a stream, and MPD playback restarts, MPD
would believe the tag should override the newly received tag. This
makes the previous tag appear stuck. This change passes the song tag
only if it's authoritative - i.e. if it's a song file.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/DecoderThread.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index dd5518b98..b4362a548 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -380,7 +380,11 @@ decoder_run_song(DecoderControl &dc, const DetachedSong &song, const char *uri, Path path_fs) { Decoder decoder(dc, dc.start_time.IsPositive(), - new Tag(song.GetTag())); + /* pass the song tag only if it's + authoritative, i.e. if it's a local file - + tags on "stream" songs are just remembered + from the last time we played it*/ + song.IsFile() ? new Tag(song.GetTag()) : nullptr); int ret; dc.state = DecoderState::START; |