From fececcea3c6e492d9d9d828d64f012bb1fdf793c Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 25 Oct 2004 20:11:35 +0000 Subject: [PATCH] parse metadata and send to output when playing another stream git-svn-id: https://svn.musicpd.org/mpd/trunk@2338 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audioOutput_shout.c | 2 -- src/decode.c | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/audioOutput_shout.c b/src/audioOutput_shout.c index 514fbbe68..777fe9c41 100644 --- a/src/audioOutput_shout.c +++ b/src/audioOutput_shout.c @@ -405,8 +405,6 @@ static void shout_sendMetadata(AudioOutput * audioOutput, MpdTag * tag) { } - DEBUG("shout: got tag\n"); - vorbis_analysis_headerout(&(sd->vd), &(sd->vc), &(sd->header_main), &(sd->header_comments), &(sd->header_codebooks)); diff --git a/src/decode.c b/src/decode.c index 55252c46e..a02dfe063 100644 --- a/src/decode.c +++ b/src/decode.c @@ -159,9 +159,7 @@ int waitOnDecode(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb, if((tag = metadataChunkToMpdTagDup(&(pc->fileMetadataChunk)))) { sendMetdataToAudioDevice(tag); - printMpdTag(stdout, tag); freeMpdTag(tag); - tag = NULL; } pc->totalTime = pc->fileTime; @@ -428,7 +426,15 @@ void handleMetadata(OutputBuffer * cb, PlayerControl * pc, int * previous, if(!(*currentChunkSent) && pc->metadataState == PLAYER_METADATA_STATE_WRITE) { + MpdTag * tag = NULL; + *currentChunkSent = 1; + + if((tag = metadataChunkToMpdTagDup(currentChunk))) { + sendMetdataToAudioDevice(tag); + freeMpdTag(tag); + } + memcpy(&(pc->metadataChunk), currentChunk, sizeof(MetadataChunk)); pc->metadataState = PLAYER_METADATA_STATE_READ;