diff options
author | Nicola Murino <nicola.murino@gmail.com> | 2015-05-08 12:44:01 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-12-21 17:02:57 +0000 |
commit | c9506728095b605716ee971c8b13f543804bea6c (patch) | |
tree | 7f9a14acb07b43a0a1433fa20a40ff01758a79bb /gst/matroska/matroska-mux.c | |
parent | 8fe478c8a7746cd2c63f20d23e97e26e1a0e6192 (diff) |
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
Diffstat (limited to 'gst/matroska/matroska-mux.c')
-rw-r--r-- | gst/matroska/matroska-mux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index ef6c03420..2a0bdcc8c 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -3536,10 +3536,12 @@ 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) { - 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; + 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); + return GST_FLOW_OK; + } } /* for dirac we have to queue up everything up to a picture unit */ |