diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-03-04 16:19:18 +0100 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2013-04-23 11:20:28 -0300 |
commit | 26c5bc1ce41c94e6398c09cdd30fdf07c57d9275 (patch) | |
tree | f5d9d72e02c5dcbe3565158d13d55908f758a839 | |
parent | 5cd07bd2af2381df345f12be89b69eb96259d4c8 (diff) |
decodebin2: update buffer size in multiqueue
When we disable buffering in the more upstream multiqueue elements,
we need to also update the queue limits. In particular, the max_size_time should
be set to 0 or else we might simply deadlock.
-rw-r--r-- | gst/playback/gstdecodebin2.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index b871cb87c..7c9c6050a 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3108,8 +3108,14 @@ decodebin_set_queue_size (GstDecodeBin * dbin, GstElement * multiqueue, { guint max_bytes, max_buffers; guint64 max_time; + gboolean use_buffering; - if (preroll || dbin->use_buffering) { + /* get the current config from the multiqueue */ + g_object_get (multiqueue, "use-buffering", &use_buffering, NULL); + + GST_DEBUG_OBJECT (multiqueue, "use buffering %d", use_buffering); + + if (preroll || use_buffering) { /* takes queue limits, initially we only queue up up to the max bytes limit, * with a default of 2MB. we use the same values for buffering mode. */ if ((max_bytes = dbin->max_size_bytes) == 0) @@ -3126,10 +3132,15 @@ decodebin_set_queue_size (GstDecodeBin * dbin, GstElement * multiqueue, max_bytes = AUTO_PLAY_SIZE_BYTES; if ((max_buffers = dbin->max_size_buffers) == 0) max_buffers = AUTO_PLAY_SIZE_BUFFERS; - if ((max_time = dbin->max_size_time) == 0) + /* this is a multiqueue with disabled buffering, don't limit max_time */ + if (dbin->use_buffering) + max_time = 0; + else if ((max_time = dbin->max_size_time) == 0) max_time = AUTO_PLAY_SIZE_TIME; } + GST_DEBUG_OBJECT (multiqueue, "setting limits %u bytes, %u buffers, " + "%" G_GUINT64_FORMAT, max_bytes, max_buffers, max_time); g_object_set (multiqueue, "max-size-bytes", max_bytes, "max-size-time", max_time, "max-size-buffers", max_buffers, NULL); @@ -3587,6 +3598,7 @@ gst_decode_group_reset_buffering (GstDecodeGroup * group) } else { g_object_set (group->multiqueue, "use-buffering", TRUE, NULL); } + decodebin_set_queue_size (group->dbin, group->multiqueue, FALSE, FALSE); GST_DEBUG_OBJECT (group->dbin, "Setting %s buffering to %d", GST_ELEMENT_NAME (group->multiqueue), !ret); |