dvb: Fixes for ATSC tuning.

ATSC is a mix of terrestrial and cable,
and depending on modulation is actually using
DVBC_ANNEX_B. Thus, we need to override the delivery
system depending on the modulation, channel by channel.

Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
This commit is contained in:
Oliver Freyermuth 2017-10-08 05:01:55 +02:00
parent 20381a5f5a
commit e46338c66a
2 changed files with 19 additions and 2 deletions

View File

@ -152,11 +152,9 @@ old_api:
if ((FE_CAN_8VSB | FE_CAN_16VSB) & fe_info.caps) {
DELSYS_SET(ret_mask, SYS_ATSC);
}
#if 0 /* Not used now. */
if ((FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_QAM_AUTO) & fe_info.caps) {
DELSYS_SET(ret_mask, SYS_DVBC_ANNEX_B);
}
#endif
break;
#endif
default:
@ -598,6 +596,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend, unsigned int delsys,
break;
#ifdef DVB_ATSC
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
MP_VERBOSE(priv, "tuning %s to %d, modulation=%d\n",
get_dvb_delsys(delsys), freq, modulation);
break;
@ -700,6 +699,7 @@ static int tune_it(dvb_priv_t *priv, int fd_frontend, unsigned int delsys,
break;
#ifdef DVB_ATSC
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
{
struct dtv_property p[] = {
{ .cmd = DTV_DELIVERY_SYSTEM, .u.data = delsys },
@ -768,6 +768,7 @@ old_api:
break;
#ifdef DVB_ATSC
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
feparams.u.vsb.modulation = modulation;
break;
#endif

View File

@ -319,6 +319,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_C:
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
mp_verbose(log, "VDR, %s, NUM: %d, NUM_FIELDS: %d, NAME: %s, "
"FREQ: %d, SRATE: %d",
get_dvb_delsys(delsys),
@ -390,6 +391,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
break;
#ifdef DVB_ATSC
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
fields = sscanf(&line[k], atsc_conf,
&ptr->freq, mod, vpid_str, apid_str);
mp_verbose(log, "%s, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d\n",
@ -523,6 +525,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_C:
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
if (!strcmp(mod, "QAM_128")) {
ptr->mod = QAM_128;
} else if (!strcmp(mod, "QAM_256")) {
@ -541,6 +544,19 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
#endif
}
}
#ifdef DVB_ATSC
/* Modulation defines real delsys for ATSC:
Terrestrial (VSB) is SYS_ATSC, Cable (QAM) is SYS_DVBC_ANNEX_B. */
if (delsys == SYS_ATSC || delsys == SYS_DVBC_ANNEX_B) {
if (ptr->mod == VSB_8 || ptr->mod == VSB_16) {
delsys = SYS_ATSC;
} else {
delsys = SYS_DVBC_ANNEX_B;
}
mp_verbose(log, "Defined delivery system for ATSC as %s from modulation.\n",
get_dvb_delsys(delsys));
}
#endif
switch (delsys) {
case SYS_DVBT: