matroskamux: fix matroskamux ! matroskademux
authorTim-Philipp Müller <tim@centricular.com>
Thu, 10 Sep 2015 15:00:50 +0000 (16:00 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 10 Sep 2015 15:05:53 +0000 (16:05 +0100)
Don't carry over DISCONT flags from the input buffers to the
output buffer, or the demuxer might reset its state when it
receives the first data buffer just after parsing the simple
block header, and then expect sane data to follow.
Fixes matroskamux ! demux erroring out.

https://bugzilla.gnome.org/show_bug.cgi?id=754768
https://bugzilla.gnome.org/show_bug.cgi?id=657805

gst/matroska/ebml-write.c

index 08868db..6b6a463 100644 (file)
@@ -255,6 +255,8 @@ gst_ebml_write_flush_cache (GstEbmlWrite * ebml, gboolean is_keyframe,
     if (GST_BUFFER_OFFSET (buffer) != ebml->last_pos) {
       gst_ebml_writer_send_segment_event (ebml, GST_BUFFER_OFFSET (buffer));
       GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
+    } else {
+      GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT);
     }
     if (ebml->writing_streamheader) {
       GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER);
@@ -463,6 +465,8 @@ gst_ebml_write_element_push (GstEbmlWrite * ebml, GstBuffer * buf,
     if (GST_BUFFER_OFFSET (buf) != ebml->last_pos) {
       gst_ebml_writer_send_segment_event (ebml, GST_BUFFER_OFFSET (buf));
       GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
+    } else {
+      GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
     }
     ebml->last_pos = ebml->pos;
     ebml->last_write_result = gst_pad_push (ebml->srcpad, buf);