qtdemux: do not push discont buffers if they aren't discont
authorThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 17 Apr 2013 19:54:22 +0000 (16:54 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 7 May 2013 22:29:17 +0000 (19:29 -0300)
qtdemux takes its buffers from a GstAdapter. Those buffers are created
from the larger buffer that it obtained from upstream and they carry
the same flags, including DISCONT if it is set. In these cases, all
buffers that qtdemux is going to push would be marked as DISCONT.

This scenario can make parsers/decoders flush on every buffer leading
to no decoding at all hapenning. This patch prevents this by unsetting
the flag if it shouldn't be set.

gst/isomp4/qtdemux.c

index 736b242..54bb05f 100644 (file)
@@ -3898,6 +3898,8 @@ gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
       GST_LOG_OBJECT (qtdemux, "marking discont buffer");
       GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
       stream->discont = FALSE;
+    } else {
+      GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
     }
 
     gst_pad_push (stream->pad, buffer);
@@ -3954,6 +3956,8 @@ gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
     GST_LOG_OBJECT (qtdemux, "marking discont buffer");
     GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
     stream->discont = FALSE;
+  } else {
+    GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
   }
 
   if (!keyframe)