some fixes to metadata stuff

git-svn-id: https://svn.musicpd.org/mpd/trunk@1370 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2004-06-07 14:16:10 +00:00
parent ae44b7dae5
commit 333c0a6fdd
3 changed files with 16 additions and 15 deletions
+11
View File
@@ -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;