summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitrios Katsaros <patcherwork@gmail.com>2020-01-17 11:22:48 +0100
committerTim-Philipp Müller <tim@centricular.com>2020-01-17 14:55:02 +0000
commit969446f1fcf38c741d40e8a220f4272194bfecc3 (patch)
treea7f5bab1a2bf582e825a074ce99cd377ef314be5
parent2e40379e7ace9c43d9edebe9556b37b541c67da7 (diff)
downloadgstreamer-plugins-base-969446f1fcf38c741d40e8a220f4272194bfecc3.tar.gz
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.
-rw-r--r--gst/playback/gsturidecodebin3.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/playback/gsturidecodebin3.c b/gst/playback/gsturidecodebin3.c
index 8b1840d14..4c5977175 100644
--- a/gst/playback/gsturidecodebin3.c
+++ b/gst/playback/gsturidecodebin3.c
@@ -264,7 +264,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
@@ -624,7 +623,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);