summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-03-01 18:49:41 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-03-02 12:08:09 +0100
commit4e4f093319e9f28d242f42b4fee3a1ae1157920d (patch)
tree0aaeeff7d36f62f9ec521a59ff017024d46db263
parent0a8cfcde877b50a06a64f7ded4807707edeb1cd9 (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 a85e815..90d4d22 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);