diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-12-15 16:29:02 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-12-22 14:42:30 +0200 |
commit | aa5f5ba8d162e9f47a3ddbfca7565a22191b65fb (patch) | |
tree | badcdd850cca527e36dcc10a54e74ef8b8805e6f | |
parent | 5266c1183d97da451920eacd811060f1e8bd6ed5 (diff) | |
download | gstreamer-plugins-base-aa5f5ba8d162e9f47a3ddbfca7565a22191b65fb.tar.gz |
decodebin: For adaptive streaming, ensure to put the buffering multiqueue after a parser or demuxer
There are cases when there is no demuxer involved that could do the
buffering, e.g. HLS with raw MP3 or AAC. In this case we want to place
the buffering multiqueue after the parser.
Before this change, we've considered the first element after the
adaptive streaming demuxer as a parser. This is not always true, e.g.
id3demux. Instead we now wait until we actually have a parser (or
decoder).
Fixes playback on such HLS streams.
-rw-r--r-- | gst/playback/gstdecodebin2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index d6872ad39..fa5d159e2 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2360,6 +2360,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, chain->demuxer = is_demuxer_element (element); chain->adaptive_demuxer = is_adaptive_demuxer_element (element); + is_decoder = strstr (gst_element_factory_get_metadata (factory, + GST_ELEMENT_METADATA_KLASS), "Decoder") != NULL; + /* For adaptive streaming demuxer we insert a multiqueue after * this demuxer. * Now for the case where we have a container stream inside these @@ -2375,7 +2378,7 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, if (chain->parent && chain->parent->parent) { GstDecodeChain *parent_chain = chain->parent->parent; - if (parent_chain->adaptive_demuxer) + if (parent_chain->adaptive_demuxer && (is_parser || is_decoder)) chain->demuxer = TRUE; } @@ -2385,8 +2388,6 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, * the parser or decoder - not elsewhere, otherwise we won't have * timestamps. */ - is_decoder = strstr (gst_element_factory_get_metadata (factory, - GST_ELEMENT_METADATA_KLASS), "Decoder") != NULL; if (!chain->parent && (is_parser || is_decoder) && dbin->use_buffering) { chain->demuxer = TRUE; |