mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
uridecodebin: set some reasonable defaults
This commit is contained in:
parent
3883fac8d8
commit
1fa7f049f1
1 changed files with 10 additions and 5 deletions
|
@ -1288,12 +1288,17 @@ make_decoder (GstURIDecodeBin * decoder)
|
||||||
g_object_set (decodebin, "use-buffering", decoder->use_buffering, NULL);
|
g_object_set (decodebin, "use-buffering", decoder->use_buffering, NULL);
|
||||||
|
|
||||||
if (decoder->use_buffering) {
|
if (decoder->use_buffering) {
|
||||||
|
guint max_bytes;
|
||||||
|
guint64 max_time;
|
||||||
|
|
||||||
/* configure sizes when buffering */
|
/* configure sizes when buffering */
|
||||||
if (decoder->buffer_size != -1)
|
if ((max_bytes = decoder->buffer_size) == -1)
|
||||||
g_object_set (decodebin, "max-size-bytes", decoder->buffer_size, NULL);
|
max_bytes = 2 * 1024 * 1024;
|
||||||
if (decoder->buffer_duration != -1)
|
if ((max_time = decoder->buffer_duration) == -1)
|
||||||
g_object_set (decodebin, "max-size-time", decoder->buffer_duration,
|
max_time = 2 * GST_SECOND;
|
||||||
NULL);
|
|
||||||
|
g_object_set (decodebin, "max-size-bytes", max_bytes, "max-size-time",
|
||||||
|
max_time, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue