From 00be69f4a04d59f1cc614b6e884e6e78d7c63603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 11 Mar 2013 10:22:07 +0100 Subject: [PATCH] omxvideodec: Disable output port when setting a new format Based on a patch by Josep Torra --- omx/gstomxvideodec.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index f9fe3278d8..98f6f83e76 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -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");