meta-digi/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0/0005-inputselector-should-p...

52 lines
1.9 KiB
Diff

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