summaryrefslogtreecommitdiff
path: root/src/outputBuffer.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/outputBuffer.c
parentae44b7dae5878a1484243b89d14317d2dab5fdde (diff)
some fixes to metadata stuff
git-svn-id: https://svn.musicpd.org/mpd/trunk@1370 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r--src/outputBuffer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index fd8d5b83f..44621d9d4 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -147,11 +147,19 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
int nextChunk;
+ static MpdTag * last = NULL;
printf("copyMpdTagToOB called\n");
if(!cb->acceptMetadata || !tag) {
sendMetaChunk = 0;
+ if(last) free(last);
+ last = NULL;
+ return 0;
+ }
+
+ if(last && mpdTagsAreEqual(last, tag)) {
+ printf("same as last\n");
return 0;
}
@@ -165,6 +173,9 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
printMpdTag(stdout, tag);
+ if(last) freeMpdTag(last);
+ last = mpdTagDup(tag);
+
copyMpdTagToMetadataChunk(tag, &(cb->metadataChunks[currentMetaChunk]));
cb->metaChunkSet[nextChunk] = 1;