From 99a6f8207f4344a45a9f975ddca071f59e9dee7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 10 Sep 2015 16:00:50 +0100 Subject: [PATCH] matroskamux: fix matroskamux ! matroskademux 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/matroska/ebml-write.c b/gst/matroska/ebml-write.c index 08868dbc49..6b6a463e5f 100644 --- a/gst/matroska/ebml-write.c +++ b/gst/matroska/ebml-write.c @@ -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);