Project

General

Profile

Bug #3081 » en50494_tune_before_diseqc.patch

works - Heinrich Lech, 2015-09-18 17:30

View differences:

src/input/mpegts/linuxdvb/linuxdvb_satconf.c
25 25
#include <sys/types.h>
26 26
#include <sys/stat.h>
27 27
#include <unistd.h>
28
#include <math.h>
28 29
#include <fcntl.h>
29 30
#include <assert.h>
30 31
#include <linux/dvb/dmx.h>
......
843 844
  //       the en50494 have to skip this test
844 845
  if (!lse->lse_lnb)
845 846
    return SM_CODE_TUNING_FAILED;
846
  f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm);
847
  if (f == (uint32_t)-1)
848
    return SM_CODE_TUNING_FAILED;
849 847

  
850
  if (ls->ls_early_tune && !lse->lse_en50494) {
848
  if (ls->ls_early_tune) {
849

  
850
    f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm);
851
    if (f == (uint32_t)-1)
852
      return SM_CODE_TUNING_FAILED;
853

  
854
    /* calculate tuning frequency for en50494 */
855
    if (lse->lse_en50494) {
856
      /* transponder value - t*/
857
      uint16_t t = round((( (f / 1000) + 2 + (((linuxdvb_en50494_t*)lse->lse_en50494)->le_frequency)) / 4) - 350);
858
      if ( t > 1024) {
859
        tvherror("en50494", "transponder value bigger then 1024");
860
        return -1;
861
      }
862
      /* tune frequency for the frontend */
863
      f = (t + 350) * 4000 - f;
864
    }
851 865
    r = linuxdvb_frontend_tune0(lfe, mmi, f);
852 866
    if (r) return r;
853 867
  } else {
854
- 
(3-3/3)