From f7d356cff2a7a6d72082232e64fd985d8c2f9a92 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 20 Nov 2014 12:28:13 +0100 Subject: [PATCH] bouquets: fastscan - do not check the frequency too strictly --- src/input/mpegts/fastscan.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/input/mpegts/fastscan.c b/src/input/mpegts/fastscan.c index 17233fb8..7f8e1a91 100644 --- a/src/input/mpegts/fastscan.c +++ b/src/input/mpegts/fastscan.c @@ -47,15 +47,13 @@ static SKEL_DECLARE(fastscan_rb_skel, dvb_fastscan_t); static int _fs_cmp(const void *a, const void *b) { - int64_t aa = ((dvb_fastscan_t *)a)->position * 1000000000LL + - ((dvb_fastscan_t *)a)->frequency; - int64_t bb = ((dvb_fastscan_t *)b)->position * 1000000000LL + - ((dvb_fastscan_t *)b)->frequency; - if (aa < bb) - return -1; - if (aa > bb) - return 1; - return 0; + int r = ((dvb_fastscan_t *)a)->position - ((dvb_fastscan_t *)b)->position; + if (r == 0) { + r = ((dvb_fastscan_t *)a)->frequency - ((dvb_fastscan_t *)b)->frequency; + if (abs(r) < 2000) + return 0; + } + return r; } void