vdpaumpegdec: hold the lock in change_state

This commit is contained in:
Carl-Anton Ingmarsson 2009-05-05 08:11:03 +02:00 committed by Jan Schmidt
parent 6b05d01898
commit de7fb2006e

View file

@ -489,9 +489,12 @@ gst_vdp_mpeg_decoder_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
g_mutex_lock (mpeg_dec->mutex);
dec->device = gst_vdp_get_device (dec->display_name);
g_mutex_unlock (mpeg_dec->mutex);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
g_mutex_lock (mpeg_dec->mutex);
gst_vdp_mpeg_decoder_reset (mpeg_dec);
dec->device->vdp_decoder_destroy (mpeg_dec->decoder);
@ -499,6 +502,7 @@ gst_vdp_mpeg_decoder_change_state (GstElement * element,
g_object_unref (dec->device);
dec->device = NULL;
g_mutex_unlock (mpeg_dec->mutex);
break;
default:
break;