mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
539eaf73e5
commit
5e364c1d7b
2 changed files with 8 additions and 4 deletions
|
@ -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). */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue