diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 94ebda98f5..9973ecf254 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -286,6 +286,9 @@ static void type_found (GstElement * typefind, guint probability, static void decodebin_set_queue_size (GstDecodeBin * dbin, GstElement * multiqueue, gboolean preroll, gboolean seekable); +static void decodebin_set_queue_size_full (GstDecodeBin * dbin, + GstElement * multiqueue, gboolean use_buffering, gboolean preroll, + gboolean seekable); static gboolean gst_decode_bin_autoplug_continue (GstElement * element, GstPad * pad, GstCaps * caps); @@ -3508,19 +3511,28 @@ gst_decode_chain_start_free_hidden_groups_thread (GstDecodeChain * chain) g_thread_unref (thread); } -/* configure queue sizes, this depends on the buffering method and if we are - * playing or prerolling. */ static void decodebin_set_queue_size (GstDecodeBin * dbin, GstElement * multiqueue, gboolean preroll, gboolean seekable) { - guint max_bytes, max_buffers; - guint64 max_time; gboolean use_buffering; /* get the current config from the multiqueue */ g_object_get (multiqueue, "use-buffering", &use_buffering, NULL); + decodebin_set_queue_size_full (dbin, multiqueue, use_buffering, preroll, + seekable); +} + +/* configure queue sizes, this depends on the buffering method and if we are + * playing or prerolling. */ +static void +decodebin_set_queue_size_full (GstDecodeBin * dbin, GstElement * multiqueue, + gboolean use_buffering, gboolean preroll, gboolean seekable) +{ + guint max_bytes, max_buffers; + guint64 max_time; + GST_DEBUG_OBJECT (multiqueue, "use buffering %d", use_buffering); if (preroll || use_buffering) { @@ -3595,7 +3607,7 @@ gst_decode_group_new (GstDecodeBin * dbin, GstDecodeChain * parent) gst_object_unref (pad); } } - decodebin_set_queue_size (dbin, mq, TRUE, seekable); + decodebin_set_queue_size_full (dbin, mq, FALSE, TRUE, seekable); group->overrunsig = g_signal_connect (mq, "overrun", G_CALLBACK (multi_queue_overrun_cb), group); @@ -4005,6 +4017,9 @@ gst_decode_group_reset_buffering (GstDecodeGroup * group) CHAIN_MUTEX_UNLOCK (chain); } + decodebin_set_queue_size_full (group->dbin, group->multiqueue, !ret, + FALSE, (group->parent ? group->parent->seekable : TRUE)); + if (ret) { /* all chains are buffering already, no need to do it here */ g_object_set (group->multiqueue, "use-buffering", FALSE, NULL); @@ -4013,8 +4028,6 @@ gst_decode_group_reset_buffering (GstDecodeGroup * group) "low-percent", group->dbin->low_percent, "high-percent", group->dbin->high_percent, NULL); } - decodebin_set_queue_size (group->dbin, group->multiqueue, FALSE, - (group->parent ? group->parent->seekable : TRUE)); GST_DEBUG_OBJECT (group->dbin, "Setting %s buffering to %d", GST_ELEMENT_NAME (group->multiqueue), !ret);