vaapidecode: unref allowed_sinkpad_caps at close()

The variable member allowed_sinkpad_caps is constructed querying the
current VA display. Bearing that in mind, the variable shall be freed
when the VA display changes or is removed.

This patch moves the freeing of allowed_sinkpad_caps to close(), when
the VA display is freed.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-10-27 18:22:18 +02:00
parent d2e801e87a
commit 02cd120bc8

View file

@ -954,8 +954,6 @@ gst_vaapidecode_finalize (GObject * object)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (object);
gst_caps_replace (&decode->allowed_sinkpad_caps, NULL);
g_cond_clear (&decode->surface_ready);
g_mutex_clear (&decode->surface_ready_mutex);
@ -985,6 +983,7 @@ gst_vaapidecode_close (GstVideoDecoder * vdec)
gst_vaapidecode_destroy (decode);
gst_caps_replace (&decode->allowed_srcpad_caps, NULL);
gst_caps_replace (&decode->allowed_sinkpad_caps, NULL);
gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (decode));
return TRUE;
}