From: Sebastian Dröge Date: Fri, 18 Nov 2011 18:00:31 +0000 (-0800) Subject: omxaudioenc: First set ports to flushing before waiting for the srcpad streaming... X-Git-Tag: 1.19.3~501^2~816 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9917fbe4c55fb9b4e9c580fc9e48dd91b0876a92;p=platform%2Fupstream%2Fgstreamer.git omxaudioenc: First set ports to flushing before waiting for the srcpad streaming thread to finish --- diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index 1a4de25..beab2b2 100644 --- a/omx/gstomxaudioenc.c +++ b/omx/gstomxaudioenc.c @@ -641,6 +641,11 @@ gst_omx_audio_enc_stop (GstBaseAudioEncoder * encoder) self = GST_OMX_AUDIO_ENC (encoder); + GST_DEBUG_OBJECT (self, "Stopping encoder"); + + gst_omx_port_set_flushing (self->in_port, TRUE); + gst_omx_port_set_flushing (self->out_port, TRUE); + gst_pad_stop_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (encoder)); if (gst_omx_component_get_state (self->component, 0) > OMX_StateIdle) @@ -655,9 +660,6 @@ gst_omx_audio_enc_stop (GstBaseAudioEncoder * encoder) g_cond_broadcast (self->drain_cond); g_mutex_unlock (self->drain_lock); - gst_omx_port_set_flushing (self->in_port, TRUE); - gst_omx_port_set_flushing (self->out_port, TRUE); - gst_omx_component_get_state (self->component, 5 * GST_SECOND); return TRUE;