summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-03-01 18:49:41 +0100
committerJosep Torra <n770galaxy@gmail.com>2014-03-05 10:44:59 +0100
commita8b9a60aa93895507abdcc3bc59eb1a5de1d4cef (patch)
tree0120f40937a46f9e7c7158e651c4053bc4f997f7
parente3cc9c192912ae3f7d70b81fa1dada40c4e8f0fb (diff)
omxvideoenc: fix startup race condition
The reset function shouldn't start the src pad loop if it wasn't started before. Signed-off-by: Christian König <christian.koenig@amd.com>
-rw-r--r--omx/gstomxvideoenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 9ab4654..622d4a1 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1339,6 +1339,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);