aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
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;