From: Sebastian Dröge Date: Thu, 10 Nov 2011 14:03:05 +0000 (+0100) Subject: omxaudioenc: Always flush the ports and make sure no processing is happening in ... X-Git-Tag: 1.0.0~263 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b62ffe1adadf87f956a8fa40089c671fe1716502;p=platform%2Fupstream%2Fgst-omx.git omxaudioenc: Always flush the ports and make sure no processing is happening in ::flush This fixes a race condition that happened when seeking very often in a short period of time. --- diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index ca045a8ed67..557d5ef2c95 100644 --- a/omx/gstomxaudioenc.c +++ b/omx/gstomxaudioenc.c @@ -806,19 +806,17 @@ gst_omx_audio_enc_flush (GstBaseAudioEncoder * encoder) GST_DEBUG_OBJECT (self, "Resetting encoder"); - if (self->started) { - gst_omx_audio_enc_drain (self); + gst_omx_audio_enc_drain (self); - gst_omx_port_set_flushing (self->in_port, TRUE); - gst_omx_port_set_flushing (self->out_port, TRUE); + gst_omx_port_set_flushing (self->in_port, TRUE); + gst_omx_port_set_flushing (self->out_port, TRUE); - /* Wait until the srcpad loop is finished */ - GST_PAD_STREAM_LOCK (GST_BASE_AUDIO_ENCODER_SRC_PAD (self)); - GST_PAD_STREAM_UNLOCK (GST_BASE_AUDIO_ENCODER_SRC_PAD (self)); + /* Wait until the srcpad loop is finished */ + GST_PAD_STREAM_LOCK (GST_BASE_AUDIO_ENCODER_SRC_PAD (self)); + GST_PAD_STREAM_UNLOCK (GST_BASE_AUDIO_ENCODER_SRC_PAD (self)); - gst_omx_port_set_flushing (self->in_port, FALSE); - gst_omx_port_set_flushing (self->out_port, FALSE); - } + gst_omx_port_set_flushing (self->in_port, FALSE); + gst_omx_port_set_flushing (self->out_port, FALSE); /* Start the srcpad loop again */ self->downstream_flow_ret = GST_FLOW_OK;