From f21d93dd65df6fc8cc9930816d44128bfd5303af Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Thu, 21 Jun 2018 18:37:56 -0700 Subject: [PATCH] Clean up difference comparison in representation.cc Change-Id: Ibde83d1b8b2f644899f93790978d906dba5d4c14 --- packager/mpd/base/representation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packager/mpd/base/representation.cc b/packager/mpd/base/representation.cc index 8bae948911..1340c2e502 100644 --- a/packager/mpd/base/representation.cc +++ b/packager/mpd/base/representation.cc @@ -420,7 +420,7 @@ bool Representation::ApproximiatelyEqual(int64_t time1, int64_t time2) const { std::min(frame_duration_, static_cast(kErrorThresholdSeconds * media_info_.reference_time_scale())); - return time1 <= time2 + error_threshold && time2 <= time1 + error_threshold; + return std::abs(time1 - time2) <= error_threshold; } int64_t Representation::AdjustDuration(int64_t duration) const {