From 48cefaf9ce81225b59d0e4b7d320bb229a6e9301 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 5 Jan 2012 16:26:49 +0100 Subject: [PATCH] vaapidecode: fix deinitialization order. --- gst/vaapi/gstvaapidecode.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 81d08a9e21..a5f0b0c5d3 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -301,17 +301,6 @@ gst_vaapidecode_create(GstVaapiDecode *decode, GstCaps *caps) static void gst_vaapidecode_destroy(GstVaapiDecode *decode) { - if (decode->decoder_ready) { - gst_vaapidecode_release(decode, NULL); - g_cond_free(decode->decoder_ready); - decode->decoder_ready = NULL; - } - - if (decode->decoder_mutex) { - g_mutex_free(decode->decoder_mutex); - decode->decoder_mutex = NULL; - } - if (decode->decoder) { gst_vaapi_decoder_put_buffer(decode->decoder, NULL); g_object_unref(decode->decoder); @@ -322,6 +311,17 @@ gst_vaapidecode_destroy(GstVaapiDecode *decode) gst_caps_unref(decode->decoder_caps); decode->decoder_caps = NULL; } + + if (decode->decoder_ready) { + gst_vaapidecode_release(decode, NULL); + g_cond_free(decode->decoder_ready); + decode->decoder_ready = NULL; + } + + if (decode->decoder_mutex) { + g_mutex_free(decode->decoder_mutex); + decode->decoder_mutex = NULL; + } } static gboolean