summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-03-21 20:36:02 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-03-21 20:38:09 +0200
commit0cc777b3b02dd89afc41a2565eccd5477781bc7e (patch)
tree231fa75b6b98e2c1691ddefca3a5467f86ab098a
parent7778e8293a9ebb28404c935e8b6cdd9dc6cc0fd4 (diff)
downloadgstreamer-plugins-bad-0cc777b3b02dd89afc41a2565eccd5477781bc7e.tar.gz
dashdemux: Don't use ABS() for calculating differences
We know which number is bigger.
-rw-r--r--ext/dash/gstdashdemux.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 06152a702..461ec7fab 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -1295,8 +1295,7 @@ gst_dash_demux_stream_sidx_seek (GstDashDemuxStream * dashstream,
* snapping */
if ((flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST) {
if (idx + 1 < sidx->entries_count
- && ABS (sidx->entries[idx + 1].pts - ts) <
- ABS (sidx->entries[idx].pts - ts))
+ && sidx->entries[idx + 1].pts - ts < ts - sidx->entries[idx].pts)
idx += 1;
} else if ((forward && (flags & GST_SEEK_FLAG_SNAP_AFTER)) || (!forward
&& (flags & GST_SEEK_FLAG_SNAP_BEFORE))) {