mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-14 02:05:39 +00:00
queue, queue2, multiqueue: Timestamps of gap events must be valid
This is checked in gst_event_new_gap() so doesn't have to be checked again here, but simply can be asserted with a g_return_if_fail(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7075>
This commit is contained in:
parent
8e9b364d9b
commit
95fdb4030f
3 changed files with 63 additions and 63 deletions
|
@ -1880,11 +1880,12 @@ apply_gap (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
gboolean is_sink = segment == &sq->sink_segment;
|
gboolean is_sink = segment == &sq->sink_segment;
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
|
||||||
|
|
||||||
gst_event_parse_gap (event, ×tamp, &duration);
|
gst_event_parse_gap (event, ×tamp, &duration);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp));
|
||||||
|
|
||||||
|
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||||
|
|
||||||
if (is_sink && !GST_CLOCK_STIME_IS_VALID (sq->sink_start_time)) {
|
if (is_sink && !GST_CLOCK_STIME_IS_VALID (sq->sink_start_time)) {
|
||||||
sq->sink_start_time = my_segment_to_running_time (segment, timestamp);
|
sq->sink_start_time = my_segment_to_running_time (segment, timestamp);
|
||||||
GST_DEBUG_ID (sq->debug_id, "Start time updated to %" GST_STIME_FORMAT,
|
GST_DEBUG_ID (sq->debug_id, "Start time updated to %" GST_STIME_FORMAT,
|
||||||
|
@ -1908,7 +1909,6 @@ apply_gap (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
|
||||||
|
|
||||||
/* calc diff with other end */
|
/* calc diff with other end */
|
||||||
update_time_level (mq, sq);
|
update_time_level (mq, sq);
|
||||||
}
|
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||||
gst_multi_queue_post_buffering (mq);
|
gst_multi_queue_post_buffering (mq);
|
||||||
|
|
|
@ -608,7 +608,8 @@ apply_gap (GstQueue * queue, GstEvent * event,
|
||||||
|
|
||||||
gst_event_parse_gap (event, ×tamp, &duration);
|
gst_event_parse_gap (event, ×tamp, &duration);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp));
|
||||||
|
|
||||||
if (is_sink && !GST_CLOCK_STIME_IS_VALID (queue->sink_start_time)) {
|
if (is_sink && !GST_CLOCK_STIME_IS_VALID (queue->sink_start_time)) {
|
||||||
queue->sink_start_time = my_segment_to_running_time (segment, timestamp);
|
queue->sink_start_time = my_segment_to_running_time (segment, timestamp);
|
||||||
GST_DEBUG_OBJECT (queue, "Start time updated to %" GST_STIME_FORMAT,
|
GST_DEBUG_OBJECT (queue, "Start time updated to %" GST_STIME_FORMAT,
|
||||||
|
@ -628,7 +629,6 @@ apply_gap (GstQueue * queue, GstEvent * event,
|
||||||
|
|
||||||
/* calc diff with other end */
|
/* calc diff with other end */
|
||||||
update_time_level (queue);
|
update_time_level (queue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -832,7 +832,8 @@ apply_gap (GstQueue2 * queue, GstEvent * event,
|
||||||
|
|
||||||
gst_event_parse_gap (event, ×tamp, &duration);
|
gst_event_parse_gap (event, ×tamp, &duration);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
g_return_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp));
|
||||||
|
|
||||||
if (is_sink && !GST_CLOCK_TIME_IS_VALID (queue->sink_start_time)) {
|
if (is_sink && !GST_CLOCK_TIME_IS_VALID (queue->sink_start_time)) {
|
||||||
queue->sink_start_time = gst_segment_to_running_time (segment,
|
queue->sink_start_time = gst_segment_to_running_time (segment,
|
||||||
GST_FORMAT_TIME, timestamp);
|
GST_FORMAT_TIME, timestamp);
|
||||||
|
@ -853,7 +854,6 @@ apply_gap (GstQueue2 * queue, GstEvent * event,
|
||||||
|
|
||||||
/* calc diff with other end */
|
/* calc diff with other end */
|
||||||
update_time_level (queue);
|
update_time_level (queue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue