From 4e4f093319e9f28d242f42b4fee3a1ae1157920d 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] 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 a85e815579..90d4d2282c 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1340,6 +1340,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);