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/879>
This commit is contained in:
Jan Schmidt 2021-09-06 01:43:57 +10:00
parent c906ccb79f
commit 5eba408071

View file

@ -1822,6 +1822,10 @@ apply_gap (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
timestamp += duration; 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; segment->position = timestamp;
if (segment == &sq->sink_segment) if (segment == &sq->sink_segment)
@ -1884,6 +1888,14 @@ get_running_time (GstSegment * segment, GstMiniObject * object, gboolean end)
my_segment_to_running_time ((GstSegment *) new_segment, my_segment_to_running_time ((GstSegment *) new_segment,
new_segment->start); 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);
}
} }
} }