vdpaumpegdec: fixup state change

This commit is contained in:
Carl-Anton Ingmarsson 2009-05-05 17:15:33 +02:00 committed by Jan Schmidt
parent e417b2eea0
commit 323b563c24
2 changed files with 9 additions and 6 deletions

View file

@ -182,7 +182,6 @@ gst_vdp_decoder_init (GstVdpDecoder * dec, GstVdpDecoderClass * klass)
(GST_ELEMENT_CLASS (klass), "sink"), "sink");
gst_pad_set_setcaps_function (dec->sink, gst_vdp_decoder_sink_set_caps);
gst_element_add_pad (GST_ELEMENT (dec), dec->sink);
gst_pad_set_active (dec->sink, TRUE);
}
static void

View file

@ -483,18 +483,23 @@ gst_vdp_mpeg_decoder_change_state (GstElement * element,
{
GstVdpMpegDecoder *mpeg_dec;
GstVdpDecoder *dec;
GstStateChangeReturn ret;
mpeg_dec = GST_VDP_MPEG_DECODER (element);
dec = GST_VDP_DECODER (mpeg_dec);
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;
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
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);
@ -502,13 +507,12 @@ 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;
}
return GST_STATE_CHANGE_SUCCESS;
return ret;
}
/* GObject vmethod implementations */