From 39c321835ba909306b6603de37fbb2b693914266 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 May 2020 14:48:04 -0400 Subject: [PATCH] videorate: Use CLOCK_TIME_IS_VALID instead of checking CLOCK_TIME_NONE Making it more consistency with the rest of the code. Part-of: --- gst/videorate/gstvideorate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index e406363144..3d47e7a6c2 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -1362,14 +1362,13 @@ gst_video_rate_transform_ip (GstBaseTransform * trans, GstBuffer * buffer) in_ts = GST_BUFFER_TIMESTAMP (buffer); in_dur = GST_BUFFER_DURATION (buffer); - if (G_UNLIKELY (in_ts == GST_CLOCK_TIME_NONE)) { + if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (in_ts))) { /* For reverse playback, we need all input timestamps as we can't * guess from the previous buffers timestamp and duration */ - if (G_UNLIKELY (in_ts == GST_CLOCK_TIME_NONE - && videorate->segment.rate < 0.0)) + if (G_UNLIKELY (videorate->segment.rate < 0.0)) goto invalid_buffer; in_ts = videorate->last_ts; - if (G_UNLIKELY (in_ts == GST_CLOCK_TIME_NONE)) + if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (in_ts))) goto invalid_buffer; } @@ -1377,7 +1376,7 @@ gst_video_rate_transform_ip (GstBaseTransform * trans, GstBuffer * buffer) * next buffer has -1 as a timestamp */ last_ts = videorate->last_ts; videorate->last_ts = in_ts; - if (in_dur != GST_CLOCK_TIME_NONE && videorate->segment.rate > 0.0) + if (GST_CLOCK_TIME_IS_VALID (in_dur) && videorate->segment.rate > 0.0) videorate->last_ts += in_dur; GST_DEBUG_OBJECT (videorate, "got buffer with timestamp %" GST_TIME_FORMAT,