mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-03 16:09:39 +00:00
vdpaumpegdec: fixup state change
This commit is contained in:
parent
e417b2eea0
commit
323b563c24
2 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue