summaryrefslogtreecommitdiff
path: root/recipes-multimedia/gstreamer/gstreamer1.0/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch
blob: f35ca044c9f73ee36168239f82a9cfc44f776b22 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 7f7398acb5dc5fdc904f6684eab2bb072be25de7 Mon Sep 17 00:00:00 2001
From: Song Bing <bing.song@nxp.com>
Date: Wed, 11 May 2016 16:57:23 +0800
Subject: [PATCH 5/7] inputselector: should proceed non-active pad buffer even
 if active pad reach eos

non-active pad will be blocked if active pad reach eos in inputselector.
Which will cause all pipeline be blocked.
Inputselector should proceed non-active pad buffer based on clock even
if active pad reach eos
Change to sync with clock for better user experience.


Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=766261]

Signed-off-by: Song Bing bing.song@nxp.com
---
 plugins/elements/gstinputselector.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index f3f95e6..f6e1993 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -772,7 +772,7 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
     }
 
     cur_running_time = GST_CLOCK_TIME_NONE;
-    if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK) {
+    if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK || active_selpad->eos) {
       clock = gst_element_get_clock (GST_ELEMENT_CAST (sel));
       if (clock) {
         GstClockTime base_time;
@@ -823,7 +823,13 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
           "Waiting for active streams to advance. %" GST_TIME_FORMAT " >= %"
           GST_TIME_FORMAT, GST_TIME_ARGS (running_time),
           GST_TIME_ARGS (cur_running_time));
-      GST_INPUT_SELECTOR_WAIT (sel);
+      if (active_selpad->eos) {
+        GST_INPUT_SELECTOR_UNLOCK (sel);
+        g_usleep (5000);
+        GST_INPUT_SELECTOR_LOCK (sel);
+      } else {
+        GST_INPUT_SELECTOR_WAIT (sel);
+      }
     } else {
       GST_INPUT_SELECTOR_UNLOCK (sel);
       break;
-- 
1.9.1