mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-02 16:52:42 +00:00
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.
This commit is contained in:
parent
074a128f0f
commit
3999a29748
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue