aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-06 16:42:14 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-06 16:42:14 +0000
commit4e53282469de4fea4b8daaec67298bd3394f34bd (patch)
treeba8465c48ea1c75983992ba4b265efd1666d9843 /src/player.c
parent926258605a56c015d1421ca5aaf818a8de343afc (diff)
downloadmpd-4e53282469de4fea4b8daaec67298bd3394f34bd.tar.gz
mpd-4e53282469de4fea4b8daaec67298bd3394f34bd.tar.xz
mpd-4e53282469de4fea4b8daaec67298bd3394f34bd.zip
todo update
git-svn-id: https://svn.musicpd.org/mpd/trunk@1352 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/player.c b/src/player.c
index cda88fff4..587a5501d 100644
--- a/src/player.c
+++ b/src/player.c
@@ -474,10 +474,12 @@ void playerCycleLogFiles() {
/* this actually creates a dupe of the current metadata */
Song * playerCurrentDecodeSong() {
static Song * song = NULL;
+ static char * prev = NULL;
PlayerControl * pc = &(getPlayerData()->playerControl);
if(pc->metadataState == PLAYER_METADATA_STATE_READ &&
- (!song || strcmp(song->utf8url, pc->currentUrl)))
+ ((!song || strcmp(song->utf8url, pc->currentUrl))
+ || (!prev || strcmp(prev,pc->metadata))))
{
if(song) freeJustSong(song);
song = newNullSong();
@@ -486,6 +488,7 @@ Song * playerCurrentDecodeSong() {
song->utf8url = strdup(pc->currentUrl);
if(pc->title >= 0) {
song->tag->title = strdup(pc->title + pc->metadata);
+ /*printf("player title: %s\n", song->tag->title);*/
}
if(pc->artist >= 0) {
song->tag->artist = strdup(pc->artist + pc->metadata);
@@ -494,11 +497,11 @@ Song * playerCurrentDecodeSong() {
song->tag->album = strdup(pc->album + pc->metadata);
}
validateUtf8Tag(song->tag);
+ if(prev) free(prev);
+ prev = strdup(pc->metadata);
resetPlayerMetadata();
return song;
}
return NULL;
}
-
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */