From de7fb2006e6bad7dba369bcd2d2fc89c965bf5f3 Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Tue, 5 May 2009 08:11:03 +0200 Subject: vdpaumpegdec: hold the lock in change_state --- sys/vdpau/gstvdpmpegdecoder.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys') diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index 413eefd4..bf3ea423 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -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; -- cgit v1.2.1