summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2021-09-06 01:43:57 +1000
committerTim-Philipp Müller <tim@centricular.com>2021-09-06 09:57:59 +0100
commitac70fb78c4f3eb13a9db3712cf30b86e11b0fb94 (patch)
tree0f187ae80f14d7c48b01c8cf722d48a00e38848d
parentd2ba6b3c91324d9b5ffc6c99d1e4f1fbe6de6cae (diff)
downloadgstreamer-ac70fb78c4f3eb13a9db3712cf30b86e11b0fb94.tar.gz
multiqueue: Use running time of gap events for wakeups.
Use gap events to update the next_time of a queue the same as buffers or segment events. Fixes problems where a group consisting only of sparse streams primarily driven by gap events would stall with a full multiqueue because unlinked streams in the group were not being woken to push data. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/881>
-rw-r--r--plugins/elements/gstmultiqueue.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index fbb3c693cb..580478d9e7 100644
--- a/plugins/elements/gstmultiqueue.c
+++ b/plugins/elements/gstmultiqueue.c
@@ -1818,6 +1818,10 @@ apply_gap (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
timestamp += duration;
}
+ GST_DEBUG_OBJECT (mq, "queue %d, %s position updated to %" GST_TIME_FORMAT,
+ sq->id, segment == &sq->sink_segment ? "sink" : "src",
+ GST_TIME_ARGS (timestamp));
+
segment->position = timestamp;
if (segment == &sq->sink_segment)
@@ -1880,6 +1884,14 @@ get_running_time (GstSegment * segment, GstMiniObject * object, gboolean end)
my_segment_to_running_time ((GstSegment *) new_segment,
new_segment->start);
}
+ } else if (GST_EVENT_TYPE (event) == GST_EVENT_GAP) {
+ GstClockTime ts, dur;
+ gst_event_parse_gap (event, &ts, &dur);
+ if (GST_CLOCK_TIME_IS_VALID (ts)) {
+ if (GST_CLOCK_TIME_IS_VALID (dur))
+ ts += dur;
+ time = my_segment_to_running_time (segment, ts);
+ }
}
}