omxvideo{enc,dec}: Only set/unset flushing state on ports if they were created already

This commit is contained in:
Sebastian Dröge 2011-07-25 13:19:06 +02:00
parent 8977906f4b
commit 8ac445abd8
2 changed files with 16 additions and 8 deletions

View file

@ -317,14 +317,18 @@ gst_omx_video_dec_change_state (GstElement * element, GstStateChange transition)
ret = GST_STATE_CHANGE_FAILURE;
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_omx_port_set_flushing (self->out_port, FALSE);
gst_omx_port_set_flushing (self->in_port, FALSE);
if (self->in_port)
gst_omx_port_set_flushing (self->in_port, FALSE);
if (self->out_port)
gst_omx_port_set_flushing (self->out_port, FALSE);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_omx_port_set_flushing (self->out_port, TRUE);
gst_omx_port_set_flushing (self->in_port, TRUE);
if (self->in_port)
gst_omx_port_set_flushing (self->in_port, TRUE);
if (self->out_port)
gst_omx_port_set_flushing (self->out_port, TRUE);
break;
default:
break;

View file

@ -312,14 +312,18 @@ gst_omx_video_enc_change_state (GstElement * element, GstStateChange transition)
ret = GST_STATE_CHANGE_FAILURE;
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_omx_port_set_flushing (self->out_port, FALSE);
gst_omx_port_set_flushing (self->in_port, FALSE);
if (self->in_port)
gst_omx_port_set_flushing (self->in_port, FALSE);
if (self->out_port)
gst_omx_port_set_flushing (self->out_port, FALSE);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_omx_port_set_flushing (self->out_port, TRUE);
gst_omx_port_set_flushing (self->in_port, TRUE);
if (self->in_port)
gst_omx_port_set_flushing (self->in_port, TRUE);
if (self->out_port)
gst_omx_port_set_flushing (self->out_port, TRUE);
break;
default:
break;