From 608a15a8853c020aec562ac16bac8e6067c6fcdd Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 7 Jun 2004 15:00:18 +0000 Subject: bug fix for metadata again, had an extra "!" in mpdTagsAreEqual() git-svn-id: https://svn.musicpd.org/mpd/trunk@1371 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/outputBuffer.c | 12 ++++++++---- src/tag.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 44621d9d4..606f231fc 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -158,24 +158,28 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) { return 0; } + if(!last) printf("OH SHIT\n"); + if(last && mpdTagsAreEqual(last, tag)) { printf("same as last\n"); return 0; } - sendMetaChunk = 1; + if(last) freeMpdTag(last); + last = NULL; + nextChunk = currentMetaChunk+1; if(nextChunk >= BUFFERED_METACHUNKS) nextChunk = 0; if(cb->metaChunkSet[nextChunk]) return -1; + sendMetaChunk = 1; currentMetaChunk = nextChunk; - printMpdTag(stdout, tag); - - if(last) freeMpdTag(last); last = mpdTagDup(tag); + printMpdTag(stdout, last); + copyMpdTagToMetadataChunk(tag, &(cb->metadataChunks[currentMetaChunk])); cb->metaChunkSet[nextChunk] = 1; diff --git a/src/tag.c b/src/tag.c index afb9d7a70..3f95f024d 100644 --- a/src/tag.c +++ b/src/tag.c @@ -205,7 +205,7 @@ int mpdTagStringsAreEqual(char * s1, char * s2) { int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2) { if(tag1 == NULL && tag2 == NULL) return 1; - else if(!tag1 || ! !tag2) return 0; + else if(!tag1 || !tag2) return 0; if(tag1->time != tag2->time) return 0; -- cgit v1.2.3