diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 441607733a..a773428d6c 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -253,6 +253,7 @@ gst_vaapidecode_release (GstVaapiDecode * decode) g_mutex_lock (&decode->surface_ready_mutex); g_cond_signal (&decode->surface_ready); g_mutex_unlock (&decode->surface_ready_mutex); + gst_object_unref (decode); } static GstFlowReturn @@ -272,7 +273,7 @@ gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec, proxy = gst_video_codec_frame_get_user_data (out_frame); gst_vaapi_surface_proxy_set_destroy_notify (proxy, - (GDestroyNotify) gst_vaapidecode_release, decode); + (GDestroyNotify) gst_vaapidecode_release, gst_object_ref (decode)); #if GST_CHECK_VERSION(1,0,0) ret = gst_video_decoder_allocate_output_frame (vdec, out_frame); @@ -645,7 +646,7 @@ gst_vaapidecode_destroy (GstVaapiDecode * decode) decode->active = FALSE; - gst_vaapidecode_release (decode); + gst_vaapidecode_release (gst_object_ref (decode)); } static gboolean