mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
omxvideodec: Only change states downwards if an upper state was reached
This commit is contained in:
parent
f0cbbad0f1
commit
252624c7cc
1 changed files with 11 additions and 11 deletions
|
@ -255,12 +255,12 @@ gst_omx_video_dec_open (GstOMXVideoDec * self)
|
|||
static gboolean
|
||||
gst_omx_video_dec_close (GstOMXVideoDec * self)
|
||||
{
|
||||
OMX_STATETYPE state;
|
||||
|
||||
gst_omx_component_set_state (self->component, OMX_StateLoaded);
|
||||
gst_omx_port_deallocate_buffers (self->in_port);
|
||||
gst_omx_port_deallocate_buffers (self->out_port);
|
||||
state = gst_omx_component_get_state (self->component, 5 * GST_SECOND);
|
||||
if (gst_omx_component_get_state (self->component, 0) > OMX_StateLoaded) {
|
||||
gst_omx_component_set_state (self->component, OMX_StateLoaded);
|
||||
gst_omx_port_deallocate_buffers (self->in_port);
|
||||
gst_omx_port_deallocate_buffers (self->out_port);
|
||||
gst_omx_component_get_state (self->component, 5 * GST_SECOND);
|
||||
}
|
||||
|
||||
self->in_port = NULL;
|
||||
self->out_port = NULL;
|
||||
|
@ -268,7 +268,7 @@ gst_omx_video_dec_close (GstOMXVideoDec * self)
|
|||
gst_omx_component_free (self->component);
|
||||
self->component = NULL;
|
||||
|
||||
return (state == OMX_StateLoaded);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -634,13 +634,13 @@ static gboolean
|
|||
gst_omx_video_dec_stop (GstBaseVideoDecoder * decoder)
|
||||
{
|
||||
GstOMXVideoDec *self;
|
||||
gboolean ret;
|
||||
|
||||
self = GST_OMX_VIDEO_DEC (decoder);
|
||||
|
||||
ret = gst_pad_stop_task (GST_BASE_VIDEO_CODEC_SRC_PAD (decoder));
|
||||
gst_pad_stop_task (GST_BASE_VIDEO_CODEC_SRC_PAD (decoder));
|
||||
|
||||
gst_omx_component_set_state (self->component, OMX_StateIdle);
|
||||
if (gst_omx_component_get_state (self->component, 0) > OMX_StateIdle)
|
||||
gst_omx_component_set_state (self->component, OMX_StateIdle);
|
||||
|
||||
gst_omx_port_set_flushing (self->in_port, TRUE);
|
||||
gst_omx_port_set_flushing (self->out_port, TRUE);
|
||||
|
@ -649,7 +649,7 @@ gst_omx_video_dec_stop (GstBaseVideoDecoder * decoder)
|
|||
|
||||
gst_buffer_replace (&self->codec_data, NULL);
|
||||
|
||||
return ret;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue