mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
msdkvpp: unref buffer pools
Unref the pools first in caps re-negotiation to avoid memory leak
This commit is contained in:
parent
3b171f70af
commit
93f72a5041
1 changed files with 6 additions and 0 deletions
|
@ -1113,6 +1113,9 @@ gst_msdkvpp_set_caps (GstBaseTransform * trans, GstCaps * caps,
|
||||||
gst_msdkvpp_set_passthrough (thiz);
|
gst_msdkvpp_set_passthrough (thiz);
|
||||||
|
|
||||||
/* Ensure sinkpad buffer pool */
|
/* Ensure sinkpad buffer pool */
|
||||||
|
if (thiz->sinkpad_buffer_pool)
|
||||||
|
gst_object_unref (thiz->sinkpad_buffer_pool);
|
||||||
|
|
||||||
thiz->sinkpad_buffer_pool =
|
thiz->sinkpad_buffer_pool =
|
||||||
gst_msdkvpp_create_buffer_pool (thiz, GST_PAD_SINK, caps,
|
gst_msdkvpp_create_buffer_pool (thiz, GST_PAD_SINK, caps,
|
||||||
thiz->in_num_surfaces);
|
thiz->in_num_surfaces);
|
||||||
|
@ -1121,6 +1124,9 @@ gst_msdkvpp_set_caps (GstBaseTransform * trans, GstCaps * caps,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* Ensure a srcpad buffer pool */
|
/* Ensure a srcpad buffer pool */
|
||||||
|
if (thiz->srcpad_buffer_pool)
|
||||||
|
gst_object_unref (thiz->srcpad_buffer_pool);
|
||||||
|
|
||||||
thiz->srcpad_buffer_pool =
|
thiz->srcpad_buffer_pool =
|
||||||
gst_msdkvpp_create_buffer_pool (thiz, GST_PAD_SRC, out_caps,
|
gst_msdkvpp_create_buffer_pool (thiz, GST_PAD_SRC, out_caps,
|
||||||
thiz->out_num_surfaces);
|
thiz->out_num_surfaces);
|
||||||
|
|
Loading…
Reference in a new issue