summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-11-23 15:28:39 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-11-23 15:28:39 +0100
commit922e048379480db16a16a3ce6bfbc48627fff611 (patch)
tree80536b5d914f6b97ff9f2df88d521d3a582d5df0
parent7ea4152323f0e3ec521e1163e5ec54406da8fc62 (diff)
queue: Only calculate level if we have valid levels
Doing calculations with GST_CLOCK_STIME_NONE would result in completely bogus levels
-rw-r--r--plugins/elements/gstqueue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c
index 9c887c1c1..431dcdca6 100644
--- a/plugins/elements/gstqueue.c
+++ b/plugins/elements/gstqueue.c
@@ -547,7 +547,8 @@ update_time_level (GstQueue * queue)
GST_LOG_OBJECT (queue, "sink %" GST_STIME_FORMAT ", src %" GST_STIME_FORMAT,
GST_STIME_ARGS (sink_time), GST_STIME_ARGS (src_time));
- if (sink_time >= src_time)
+ if (GST_CLOCK_STIME_IS_VALID (src_time)
+ && GST_CLOCK_STIME_IS_VALID (sink_time) && sink_time >= src_time)
queue->cur_level.time = sink_time - src_time;
else
queue->cur_level.time = 0;