Skip to content

Commit 630d68d

Browse files
committed
player/Thread: merge tag for songs have range instead of replacing with chunk->tag
While playing first track of cue file on satellite setup, the tag of currentsong will loss. This is due to `chunk->tag` overwriting song tag in `PlayerControl::PlayChunk`. In local cue files, `song_tag` is used to form `stream_tag` and merged into `chunk->tag`, but `song_tag` only works for local files. So the `chunk->tag` is decided by decoded tag from audio files, which in cue's case is the whole album file and doesn't contain track metadata. This commit fixes the issue by merging song's tag with `chunk->tag` (with `chunk->tag` prioritized) in `PlayerControl::LockUpdateSongTag`, only when the song's `end_time` is not zero. As the `end_time` will only be set on cue virtual songs or with `rangeid` command, i.e. songs represented by portion of a whole file, where metadata of the portion and whole file may differ. The impact to current behaviour is minimized: changes only happen when users use `rangeid` command on a remote song, and they expect that song tags in database should be completely overwritten with tags provided by remote stream instead of merged.
1 parent 0f7ee06 commit 630d68d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/player/Thread.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,10 @@ PlayerControl::LockUpdateSongTag(DetachedSong &song,
903903
streams may change tags dynamically */
904904
return;
905905

906-
song.SetTag(new_tag);
906+
if (!song.GetEndTime().IsZero())
907+
song.SetTag(Tag::Merge(song.GetTag(), new_tag));
908+
else
909+
song.SetTag(new_tag);
907910

908911
LockSetTaggedSong(song);
909912

0 commit comments

Comments
 (0)