some debug and some cosmetics

This commit is contained in:
Robert 2009-12-12 20:43:46 +00:00
parent b654442eec
commit d0f92bd9ae
2 changed files with 29 additions and 22 deletions

View file

@ -327,11 +327,12 @@ dvb_fe_tune(th_dvb_mux_instance_t *tdmi, const char *reason)
hiband = switchfreq && p->frequency > switchfreq;
pol = tdmi->tdmi_conf.dmc_polarisation;
diseqc_setup(tda->tda_fe_fd,
if ((r = diseqc_setup(tda->tda_fe_fd,
port,
pol == POLARISATION_HORIZONTAL ||
pol == POLARISATION_CIRCULAR_LEFT,
hiband, tda->tda_diseqc_version);
hiband, tda->tda_diseqc_version)) != 0)
tvhlog(LOG_ERR, "dvb", "diseqc setup failed %d\n", r);
if(hiband)
p->frequency = abs(p->frequency - hifreq);

View file

@ -882,6 +882,7 @@ dvb_table_sat_delivery(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
uint16_t tsid)
{
int freq, symrate;
uint16_t orbital_pos;
struct dvb_mux_conf dmc;
if(!tdmi->tdmi_adapter->tda_autodiscovery)
@ -901,6 +902,8 @@ dvb_table_sat_delivery(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
if(!freq)
return -1;
orbital_pos = bcdtoint(ptr[4]) * 100 + bcdtoint(ptr[5]);
symrate =
bcdtoint(ptr[7]) * 100000 + bcdtoint(ptr[8]) * 1000 +
bcdtoint(ptr[9]) * 10 + (ptr[10] >> 4);
@ -924,29 +927,32 @@ dvb_table_sat_delivery(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
else
dmc.dmc_fe_modulation = 0;
if (ptr[6] & 0x04) {
if (ptr[6] & 0x04)
dmc.dmc_fe_delsys = SYS_DVBS2;
switch ((ptr[6] >> 3) & 0x03) {
case 0x00:
dmc.dmc_fe_rolloff = ROLLOFF_35;
break;
case 0x01:
dmc.dmc_fe_rolloff = ROLLOFF_25;
break;
case 0x02:
dmc.dmc_fe_rolloff = ROLLOFF_20;
break;
default:
case 0x03:
dmc.dmc_fe_rolloff = ROLLOFF_AUTO;
break;
}
}
else {
else
dmc.dmc_fe_delsys = SYS_DVBS;
dmc.dmc_fe_rolloff = ROLLOFF_35;
switch ((ptr[6] >> 3) & 0x03) {
case 0x00:
dmc.dmc_fe_rolloff = ROLLOFF_35;
break;
case 0x01:
dmc.dmc_fe_rolloff = ROLLOFF_25;
break;
case 0x02:
dmc.dmc_fe_rolloff = ROLLOFF_20;
break;
default:
case 0x03:
dmc.dmc_fe_rolloff = ROLLOFF_AUTO;
break;
}
if (dmc.dmc_fe_delsys == SYS_DVBS && dmc.dmc_fe_rolloff != ROLLOFF_35) {
printf ("error descriptor\n");
return -1;
}
#endif
dvb_mux_create(tdmi->tdmi_adapter, &dmc, tsid, NULL,
"automatic mux discovery", 1, NULL);