aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-07 14:16:10 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-07 14:16:10 +0000
commit333c0a6fdd6039e936f0de1cd9f7534a9339deda (patch)
treef1deee5d78f123d6f19e9f05d9b4346e5dd86f44 /src/player.c
parentae44b7dae5878a1484243b89d14317d2dab5fdde (diff)
downloadmpd-333c0a6fdd6039e936f0de1cd9f7534a9339deda.tar.gz
mpd-333c0a6fdd6039e936f0de1cd9f7534a9339deda.tar.xz
mpd-333c0a6fdd6039e936f0de1cd9f7534a9339deda.zip
some fixes to metadata stuff
git-svn-id: https://svn.musicpd.org/mpd/trunk@1370 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c
index 3ddd21062..0682a537a 100644
--- a/src/player.c
+++ b/src/player.c
@@ -470,6 +470,7 @@ void playerCycleLogFiles() {
Song * playerCurrentDecodeSong() {
static Song * song = NULL;
static MetadataChunk * prev = NULL;
+ Song * ret = NULL;
PlayerControl * pc = &(getPlayerData()->playerControl);
if(pc->metadataState == PLAYER_METADATA_STATE_READ &&
@@ -477,19 +478,19 @@ Song * playerCurrentDecodeSong() {
|| (!prev || memcmp(prev, &(pc->metadataChunk),
sizeof(MetadataChunk)))))
{
- printf("metadata in the PLAYER!\n");
if(prev) free(prev);
prev = malloc(sizeof(MetadataChunk));
memcpy(prev, &(pc->metadataChunk), sizeof(MetadataChunk));
- resetPlayerMetadata();
if(song) freeJustSong(song);
song = newNullSong();
if(song->utf8url) free(song->utf8url);
song->utf8url = strdup(pc->currentUrl);
song->tag = metadataChunkToMpdTagDup(prev);
validateUtf8Tag(song->tag);
- return song;
+ ret = song;
}
- return NULL;
+ resetPlayerMetadata();
+
+ return ret;
}