From 43acfbbb86c4c140dc1f90bed31e7c0d708b74fd Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 8 Apr 2014 19:27:55 -0400 Subject: [PATCH] bufferpool: Update the configure even if set_config() returned false According to the documentation, when set_config() return false, it should be possible to read the modified version of the config. This patch fixes the implementation so it is now according to the documentation. https://bugzilla.gnome.org/show_bug.cgi?id=727916 --- gst/gstbufferpool.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 192693f..2133c36 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -638,15 +638,15 @@ gst_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) else result = FALSE; - if (result) { - if (priv->config) - gst_structure_free (priv->config); - priv->config = config; + /* save the config regardless of the result so user can read back the + * modified config and evaluate if the changes are acceptable */ + if (priv->config) + gst_structure_free (priv->config); + priv->config = config; + if (result) { /* now we are configured */ priv->configured = TRUE; - } else { - gst_structure_free (config); } GST_BUFFER_POOL_UNLOCK (pool); -- 2.7.4