diff options
author | Luis de Bethencourt <luisbg@osg.samsung.com> | 2015-10-02 11:49:35 +0100 |
---|---|---|
committer | Luis de Bethencourt <luisbg@osg.samsung.com> | 2015-10-02 11:49:39 +0100 |
commit | 3999a29748724e79ab9be8e18629cd70a82d56d2 (patch) | |
tree | 7c800ac405c6a6da0a3569ff39d0016358c68615 | |
parent | 074a128f0fd5b68a7cf43d0d93e1d61d90df63db (diff) | |
download | gst-libav-3999a29748724e79ab9be8e18629cd70a82d56d2.tar.gz |
avviddec: only free config when pool doesn't take ownership
Since gst_buffer_pool_set_config() takes ownership of the config structure,
it is only necessary to free the structure before using it when the true
branch of if (gst_buffer_pool_config_validate_params) hasn't run.
gst_buffer_pool_set_config() always takes ownership of the structure
regardless of success or failure. Which means the return, checked with
if (!working_pool), has no relation to the state of the structure.
-rw-r--r-- | ext/libav/gstavviddec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index d9344fa..f139aee 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1884,12 +1884,13 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) if (gst_buffer_pool_config_validate_params (config, state->caps, size, min, max)) { working_pool = gst_buffer_pool_set_config (pool, config); + } else { + gst_structure_free (config); } if (!working_pool) { gst_object_unref (pool); pool = gst_video_buffer_pool_new (); - gst_structure_free (config); config = gst_buffer_pool_get_config (pool); gst_buffer_pool_config_set_params (config, state->caps, size, min, max); gst_buffer_pool_config_set_allocator (config, NULL, ¶ms); |