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.
This commit is contained in:
Sebastian Dröge 2016-12-15 16:29:02 +02:00
parent 4dd7a25d2d
commit 991758c3d6

View file

@ -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;