From 19b7b248cc02051924d478c102ba4895034b7fb2 Mon Sep 17 00:00:00 2001 From: Dimitrios Katsaros Date: Fri, 17 Jan 2020 11:22:48 +0100 Subject: [PATCH] uridecodebin3: Fixed defauts not being set on initialization The default values were not being set on element initialization. This was a problem for buffer_duration and buffer_size since they would be zero initialized, rather then being set to -1. This would cause the underlaying queue2 element to have no limits and depending on the streamed file, could cause queue2 to allocate massive amounts of memory. --- gst/playback/gsturidecodebin3.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/playback/gsturidecodebin3.c b/gst/playback/gsturidecodebin3.c index 1b3ede2..dbf9035 100644 --- a/gst/playback/gsturidecodebin3.c +++ b/gst/playback/gsturidecodebin3.c @@ -265,7 +265,6 @@ static GstStaticCaps raw_video_caps = GST_STATIC_CAPS ("video/x-raw(ANY)"); /* properties */ #define DEFAULT_PROP_URI NULL #define DEFAULT_PROP_SUBURI NULL -#define DEFAULT_PROP_SOURCE NULL #define DEFAULT_CONNECTION_SPEED 0 #define DEFAULT_CAPS (gst_static_caps_get (&default_raw_caps)) #define DEFAULT_BUFFER_DURATION -1 @@ -640,7 +639,15 @@ gst_uri_decode_bin3_init (GstURIDecodeBin3 * dec) { g_mutex_init (&dec->lock); - dec->caps = gst_static_caps_get (&default_raw_caps); + dec->uri = DEFAULT_PROP_URI; + dec->suburi = DEFAULT_PROP_SUBURI; + dec->connection_speed = DEFAULT_CONNECTION_SPEED; + dec->caps = DEFAULT_CAPS; + dec->buffer_duration = DEFAULT_BUFFER_DURATION; + dec->buffer_size = DEFAULT_BUFFER_SIZE; + dec->download = DEFAULT_DOWNLOAD; + dec->use_buffering = DEFAULT_USE_BUFFERING; + dec->ring_buffer_max_size = DEFAULT_RING_BUFFER_MAX_SIZE; dec->decodebin = gst_element_factory_make ("decodebin3", NULL); gst_bin_add (GST_BIN_CAST (dec), dec->decodebin); -- 2.7.4