From e3e7ba0d1a51d084e5d9cf27d0391ce5a989b834 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 18 Nov 2009 14:50:28 -0300 Subject: [PATCH] decodebin2: set to buffer less on no-more-pads When a decodebin2 receives no-more-pads of a group it can set that group's multiqueue buffering thresholds to 'playing' buffering method, avoiding that it buffers too long and cause problems when using with queue2. See the associated bug for details. Fixes #600787 --- gst/playback/gstdecodebin2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 10cf292ca5..db9cc291db 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -266,6 +266,9 @@ static void do_async_done (GstDecodeBin * dbin); static void type_found (GstElement * typefind, guint probability, GstCaps * caps, GstDecodeBin * decode_bin); +static void decodebin_set_queue_size (GstDecodeBin * dbin, + GstElement * multiqueue, gboolean preroll); + static gboolean gst_decode_bin_autoplug_continue (GstElement * element, GstPad * pad, GstCaps * caps); static GValueArray *gst_decode_bin_autoplug_factories (GstElement * @@ -1874,6 +1877,11 @@ no_more_pads_cb (GstElement * element, GstDecodeChain * chain) GST_DEBUG_OBJECT (element, "Setting group %p to complete", group); group->no_more_pads = TRUE; + /* this group has prerolled enough to not need more pads, + * we can probably set its buffering state to playing now */ + GST_DEBUG_OBJECT (group->dbin, "Setting group %p multiqueue to " + "'playing' buffering mode", group); + decodebin_set_queue_size (group->dbin, group->multiqueue, FALSE); CHAIN_MUTEX_UNLOCK (chain); EXPOSE_LOCK (chain->dbin);