From d5371b9208f5fa20be6453356b6f6ec821e681ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 4 Nov 2011 09:43:32 +0100 Subject: [PATCH] omxvideodec: Only drain the component a single time and only after processing started --- omx/gstomxvideodec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 3abcd5b..210a229 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1054,7 +1054,11 @@ gst_omx_video_dec_set_format (GstBaseVideoDecoder * decoder, } if (needs_disable && is_format_change) { - gst_omx_video_dec_drain (self); + if (self->started) { + gst_omx_video_dec_drain (self); + self->started = FALSE; + } + if (klass->hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) { GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self); gst_omx_video_dec_stop (GST_BASE_VIDEO_DECODER (self)); @@ -1174,6 +1178,7 @@ gst_omx_video_dec_reset (GstBaseVideoDecoder * decoder) if (self->started) { gst_omx_video_dec_drain (self); + self->started = FALSE; gst_omx_port_set_flushing (self->in_port, TRUE); gst_omx_port_set_flushing (self->out_port, TRUE); @@ -1426,6 +1431,8 @@ gst_omx_video_dec_drain (GstOMXVideoDec * self) GST_DEBUG_OBJECT (self, "Draining component"); + g_assert (self->started); + /* Send an EOS buffer to the component and let the base * class drop the EOS event. We will send it later when * the EOS buffer arrives on the output port. */ -- 2.7.4