aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 0c499f0ad..429bfe903 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -734,11 +734,34 @@ int playPlaylist(FILE * fp, int song, int stopOnError) {
return playPlaylistOrderNumber(fp,i);
}
+void syncCurrentPlayerDecodeMetadata() {
+ long i = 0;
+ Song * songPlayer = playerCurrentDecodeSong();
+ Song * song;
+
+ if(!songPlayer) return;
+
+ for(i=0; i<playlist.length; i++) {
+ song = playlist.songs[i];
+
+ if(song->type == SONG_TYPE_URL &&
+ 0 == strcmp(song->utf8url,
+ songPlayer->utf8url))
+ {
+ if(song->tag) freeMpdTag(song->tag);
+ song->tag = mpdTagDup(songPlayer->tag);
+ incrPlaylistVersion();
+ }
+ }
+}
+
void syncPlayerAndPlaylist() {
if(playlist_state!=PLAYLIST_STATE_PLAY) return;
if(getPlayerState()==PLAYER_STATE_STOP) playPlaylistIfPlayerStopped();
else syncPlaylistWithQueue(!playlist_queueError);
+
+ syncCurrentPlayerDecodeMetadata();
}
int currentSongInPlaylist(FILE * fp) {