vaapidecode: fix deinitialization order.

This commit is contained in:
Gwenole Beauchesne 2012-01-05 16:26:49 +01:00
parent 0afd2e5c42
commit 48cefaf9ce

View file

@ -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