aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-01 10:28:06 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-01 10:28:06 +0000
commit199ad37e22ac9e3e801506793f3c0897ed62bc68 (patch)
tree837d7452072ace239cac857d396b80622c6b4361 /src/playlist.c
parentdecce92949d7a35f1e27804df45fa61568e69548 (diff)
downloadmpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.tar.gz
mpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.tar.xz
mpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.zip
more efficient of updating of metadata
git-svn-id: https://svn.musicpd.org/mpd/trunk@1277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playlist.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 429bfe903..4d9c0da96 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -735,23 +735,22 @@ int playPlaylist(FILE * fp, int song, int stopOnError) {
}
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(playlist_state!=PLAYLIST_STATE_PLAY);
- if(song->type == SONG_TYPE_URL &&
- 0 == strcmp(song->utf8url,
- songPlayer->utf8url))
- {
- if(song->tag) freeMpdTag(song->tag);
- song->tag = mpdTagDup(songPlayer->tag);
- incrPlaylistVersion();
- }
+ song = playlist.songs[playlist.order[playlist.current]];
+
+ if(song->type == SONG_TYPE_URL &&
+ 0 == strcmp(song->utf8url, songPlayer->utf8url) &&
+ !mpdTagsAreEqual(song->tag, songPlayer->tag))
+ {
+ if(song->tag) freeMpdTag(song->tag);
+ song->tag = mpdTagDup(songPlayer->tag);
+ incrPlaylistVersion();
}
}