decodebin: Buffer up to 5 seconds in multiqueue buffering mode

2 seconds might be too small for some container formats, e.g.
MPEGTS with some video codec and AAC/ADTS audio with 700ms
long buffers. The video branch of multiqueue can run full while
the audio branch is completely empty, especially because there
are usually more queues downstream on the audio branch.
This commit is contained in:
Sebastian Dröge 2014-03-07 17:09:24 +01:00
parent 539eaf73e5
commit 5e364c1d7b
2 changed files with 8 additions and 4 deletions

View file

@ -3194,9 +3194,13 @@ decodebin_set_queue_size (GstDecodeBin * dbin, GstElement * multiqueue,
max_bytes = AUTO_PREROLL_SIZE_BYTES;
if (preroll || (max_buffers = dbin->max_size_buffers) == 0)
max_buffers = AUTO_PREROLL_SIZE_BUFFERS;
if (preroll || (max_time = dbin->max_size_time) == 0)
max_time = seekable ? AUTO_PREROLL_SEEKABLE_SIZE_TIME :
AUTO_PREROLL_NOT_SEEKABLE_SIZE_TIME;
if (preroll || (max_time = dbin->max_size_time) == 0) {
if (dbin->use_buffering && !preroll)
max_time = 5 * GST_SECOND;
else
max_time = seekable ? AUTO_PREROLL_SEEKABLE_SIZE_TIME :
AUTO_PREROLL_NOT_SEEKABLE_SIZE_TIME;
}
} else {
/* update runtime limits. At runtime, we try to keep the amount of buffers
* in the queues as low as possible (but at least 5 buffers). */

View file

@ -1837,7 +1837,7 @@ make_decoder (GstURIDecodeBin * decoder)
if ((max_bytes = decoder->buffer_size) == -1)
max_bytes = 2 * 1024 * 1024;
if ((max_time = decoder->buffer_duration) == -1)
max_time = 2 * GST_SECOND;
max_time = 5 * GST_SECOND;
g_object_set (decodebin, "max-size-bytes", max_bytes, "max-size-buffers",
(guint) 0, "max-size-time", max_time, NULL);