aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-multimedia/gstreamer/gstreamer1.0-omx/0010-omxvideoenc-fix-startup-race-condition.patch
blob: 68b89b8a258b2b1ac8595b409de30d3516beb4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From ba51373c66f4c9c3349eb083c5218b31e4162a6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
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 <christian.koenig@amd.com>
---
 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