From ba51373c66f4c9c3349eb083c5218b31e4162a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 1 Mar 2014 18:49:41 +0100 Subject: [PATCH 10/11] omxvideoenc: fix startup race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reset function shouldn't start the src pad loop if it wasn't started before. Signed-off-by: Christian König --- omx/gstomxvideoenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index ee41fa0..e65a9e0 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1359,6 +1359,9 @@ gst_omx_video_enc_reset (GstVideoEncoder * encoder, gboolean hard) GST_DEBUG_OBJECT (self, "Resetting encoder"); + if (gst_omx_component_get_state (self->enc, 0) == OMX_StateLoaded) + return TRUE; + gst_omx_port_set_flushing (self->enc_in_port, 5 * GST_SECOND, TRUE); gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, TRUE); -- 1.7.9.5