From: Heiko-L Date: Fri, 18 Sep 2015 15:27:02 +0000 (+0200) Subject: en50494: added "tune before diseqc", fixes #3081 X-Git-Tag: v4.2.1~2095 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f8aa9705df90dccda899710671e83e3acb3c8d6;p=thirdparty%2Ftvheadend.git en50494: added "tune before diseqc", fixes #3081 --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index 960eabeb8..cd73f2a68 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -843,11 +844,24 @@ linuxdvb_satconf_start_mux // the en50494 have to skip this test if (!lse->lse_lnb) return SM_CODE_TUNING_FAILED; - f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm); - if (f == (uint32_t)-1) - return SM_CODE_TUNING_FAILED; - if (ls->ls_early_tune && !lse->lse_en50494) { + if (ls->ls_early_tune) { + + f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm); + if (f == (uint32_t)-1) + return SM_CODE_TUNING_FAILED; + + /* calculate tuning frequency for en50494 */ + if (lse->lse_en50494) { + /* transponder value - t*/ + uint16_t t = round((( (f / 1000) + 2 + (((linuxdvb_en50494_t*)lse->lse_en50494)->le_frequency)) / 4) - 350); + if ( t > 1024) { + tvherror("en50494", "transponder value bigger then 1024"); + return -1; + } + /* tune frequency for the frontend */ + f = (t + 350) * 4000 - f; + } r = linuxdvb_frontend_tune0(lfe, mmi, f); if (r) return r; } else {