Commit c9506728 authored by Nicola Murino's avatar Nicola Murino Committed by Tim-Philipp Müller

matroskamux: only drop actual streamheader buffers with xiph codecs

With Xiph codecs the stream header buffers are both in the caps and are
usually also at the beginning of each input stream, but it's perfectly
possible that the input stream does not have the stream header buffers
inline in the data. Matroskamux would drop the first N buffers assuming
they're stream headers, but this meant it would drop actual payload data
when the stream didn't contain the stream headers inline. Fix this by
only dropping leading buffers if they're flagged as stream headers. This
fixes issues with streams that are being tapped into after streaming
has started.

https://bugzilla.gnome.org/show_bug.cgi?id=749098
parent 8fe478c8
......@@ -3536,11 +3536,13 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad,
/* vorbis/theora headers are retrieved from caps and put in CodecPrivate */
if (collect_pad->track->xiph_headers_to_skip > 0) {
--collect_pad->track->xiph_headers_to_skip;
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_HEADER)) {
GST_LOG_OBJECT (collect_pad->collect.pad, "dropping streamheader buffer");
gst_buffer_unref (buf);
--collect_pad->track->xiph_headers_to_skip;
return GST_FLOW_OK;
}
}
/* for dirac we have to queue up everything up to a picture unit */
if (!strcmp (collect_pad->track->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_DIRAC)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment