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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user