decodebin2: Set a time limit on "upstream" multiqueues
authorEdward Hervey <edward@centricular.com>
Tue, 17 Jan 2017 12:52:20 +0000 (13:52 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 31 May 2017 07:27:19 +0000 (10:27 +0300)
Those multiqueue are the ones dealing with adaptive demuxers. They should
have a time limit set so that they don't end up buffering too much data.

They would previously be set with no limits at all, which would cause them
to grow indefinitely until downstream blocks.

gst/playback/gstdecodebin2.c

index b17f124..65346cf 100644 (file)
@@ -241,7 +241,7 @@ enum
  * as low as possible (try to aim for 5 buffers) */
 #define AUTO_PLAY_SIZE_BYTES        2 * 1024 * 1024
 #define AUTO_PLAY_SIZE_BUFFERS      5
-#define AUTO_PLAY_SIZE_TIME         0
+#define AUTO_PLAY_SIZE_TIME         5 * GST_SECOND
 
 #define DEFAULT_SUBTITLE_ENCODING NULL
 #define DEFAULT_USE_BUFFERING     FALSE
@@ -3732,7 +3732,7 @@ decodebin_set_queue_size_full (GstDecodeBin * dbin, GstElement * multiqueue,
     if ((max_buffers = dbin->max_size_buffers) == 0)
       max_buffers = AUTO_PLAY_SIZE_BUFFERS;
     /* this is a multiqueue with disabled buffering, don't limit max_time */
-    if (dbin->use_buffering)
+    if (use_buffering)
       max_time = 0;
     else if ((max_time = dbin->max_size_time) == 0)
       max_time = AUTO_PLAY_SIZE_TIME;