From 991758c3d68a0a7131df4e6244fe3ce29f2b9f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 15 Dec 2016 16:29:02 +0200 Subject: [PATCH] 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. --- gst/playback/gstdecodebin2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index d6872ad397..fa5d159e21 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;