diff -r 40368fdba59a scan.c --- a/scan.c +++ b/scan.c @@ -393,25 +397,32 @@ static void parse_s2_satellite_delivery_ static void parse_satellite_delivery_system_descriptor (const unsigned char *buf, struct transponder *t) { - static const fe_code_rate_t fec_tab [8] = { - FEC_AUTO, FEC_1_2, FEC_2_3, FEC_3_4, - FEC_5_6, FEC_7_8, FEC_NONE, FEC_NONE - }; - if (!t) { warning("satellite_delivery_system_descriptor outside transport stream definition (ignored)\n"); return; } - if(((buf[8] >> 1) & 0x01) == 0) { - t->delivery_system = SYS_DVBS; - } - else { - t->delivery_system = SYS_DVBS2; + switch ( getBits(buf,69,1) ) { + case 0: t->delivery_system = SYS_DVBS; break; + case 1: t->delivery_system = SYS_DVBS2; break; } t->frequency = 10 * bcd32_to_cpu (buf[2], buf[3], buf[4], buf[5]); - t->fec = fec_tab[buf[12] & 0x07]; + + switch ( getBits(buf,100,4) ) { + case 0 : t->fec = FEC_AUTO; break; + case 1 : t->fec = FEC_1_2; break; + case 2 : t->fec = FEC_2_3; break; + case 3 : t->fec = FEC_3_4; break; + case 4 : t->fec = FEC_5_6; break; + case 5 : t->fec = FEC_7_8; break; + case 6 : t->fec = FEC_8_9; break; + case 7 : t->fec = FEC_3_5; break; + case 8 : t->fec = FEC_4_5; break; + case 9 : t->fec = FEC_9_10; break; + case 15 : t->fec = FEC_NONE; break; + } + t->symbol_rate = 10 * bcd32_to_cpu (buf[9], buf[10], buf[11], buf[12] & 0xf0); t->inversion = spectral_inversion; @@ -419,6 +430,13 @@ static void parse_satellite_delivery_sys t->polarisation = (buf[8] >> 5) & 0x03; t->orbital_pos = bcd32_to_cpu (0x00, 0x00, buf[6], buf[7]); t->we_flag = buf[8] >> 7; + + switch ( getBits(buf,70,2) ) { + case 0 : t->modulation = QAM_AUTO; break; + case 1 : t->modulation = QPSK; break; + case 2 : t->modulation = PSK_8; break; + case 3 : t->modulation = QAM_16; break; + } if (verbosity >= 5) { debug("%#04x/%#04x ", t->network_id, t->transport_stream_id); @@ -1858,7 +1892,7 @@ struct strtab qamtab[] = { static enum fe_modulation str2qam(const char *qam) { - return str2enum(qam, qamtab, QAM_AUTO); + return str2enum(qam, qamtab, QPSK); } static const char* qam2str(enum fe_modulation qam) @@ -1968,8 +2074,8 @@ static int tune_initial (int frontend_fd else if (sscanf(buf, "S %u %1[HVLR] %u %4s %4s %6s\n", &f, pol, &sr, fec, rolloff, qam) >= 3) { t = alloc_transponder(f); t->delivery_system = SYS_DVBS; - t->modulation = QAM_AUTO; - t->rolloff = ROLLOFF_AUTO; + t->modulation = QPSK; + t->rolloff = ROLLOFF_35; t->fec = FEC_AUTO; switch(pol[0]) {