omxvideodec: Disable output port when setting a new format

Based on a patch by Josep Torra <n770galaxy@gmail.com>
This commit is contained in:
Sebastian Dröge 2013-03-11 10:22:07 +01:00
parent 65174bbd7f
commit 00be69f4a0

View file

@ -2025,14 +2025,24 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
} else {
if (gst_omx_port_set_enabled (self->dec_in_port, FALSE) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_set_enabled (self->dec_out_port, FALSE) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_wait_buffers_released (self->dec_in_port,
5 * GST_SECOND) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_wait_buffers_released (self->dec_out_port,
1 * GST_SECOND) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_deallocate_buffers (self->dec_in_port) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_deallocate_buffers (self->dec_out_port) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_wait_enabled (self->dec_in_port,
1 * GST_SECOND) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_wait_enabled (self->dec_out_port,
1 * GST_SECOND) != OMX_ErrorNone)
return FALSE;
}
if (self->input_state)
gst_video_codec_state_unref (self->input_state);
@ -2124,10 +2134,6 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
return FALSE;
}
if (!needs_disable)
if (gst_omx_port_populate (self->dec_out_port) != OMX_ErrorNone)
return FALSE;
/* Start the srcpad loop again */
GST_DEBUG_OBJECT (self, "Starting task again");