decodebin: Always add a multiqueue in single-stream use-buffering pipelines

If we are configured to use buffering and there is no demuxer in the chain, we
still want a multiqueue, otherwise we will ignore the use-buffering property.
In that case, we will insert a multiqueue after the parser or decoder - not
elsewhere, otherwise we won't have timestamps.

https://bugzilla.gnome.org/show_bug.cgi?id=764948
This commit is contained in:
Vivia Nikolaidou 2016-04-12 16:32:20 +03:00 committed by Sebastian Dröge
parent ef1a99d4d8
commit 2b53646715

View file

@ -2133,6 +2133,7 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
GList *to_connect = NULL;
GList *to_expose = NULL;
gboolean is_parser = FALSE;
gboolean is_decoder = FALSE;
/* Set dpad target to pad again, it might've been unset
* below but we came back here because something failed
@ -2394,6 +2395,23 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
chain->demuxer = TRUE;
}
/* If we are configured to use buffering and there is no demuxer in the
* chain, we still want a multiqueue, otherwise we will ignore the
* use-buffering property. In that case, we will insert a multiqueue after
* 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;
if (is_decoder) {
GST_WARNING_OBJECT (dbin,
"Buffering messages used for decoded and non-parsed data");
}
}
CHAIN_MUTEX_UNLOCK (chain);
/* Set connection-speed property if needed */