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.
This commit is contained in:
Max Kellermann 2015-06-21 15:02:14 +02:00
parent e4d0293a31
commit 9acefcb256
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -4,6 +4,7 @@ ver 0.19.10 (not yet released)
- smbclient: fix DFF playback - smbclient: fix DFF playback
* decoder * decoder
- ffmpeg: improve seeking accuracy - ffmpeg: improve seeking accuracy
- fix stuck stream tags
* encoder * encoder
- opus: fix bogus granulepos - opus: fix bogus granulepos
* output * output

View File

@ -380,7 +380,11 @@ decoder_run_song(DecoderControl &dc,
const DetachedSong &song, const char *uri, Path path_fs) const DetachedSong &song, const char *uri, Path path_fs)
{ {
Decoder decoder(dc, dc.start_time.IsPositive(), 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; int ret;
dc.state = DecoderState::START; dc.state = DecoderState::START;