Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tvhdhomerun: Add ATSC type for device-override
  • Loading branch information
pakar authored and perexg committed Oct 14, 2014
1 parent 6718019 commit 24d2ab4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/input/mpegts/tvhdhomerun/tvhdhomerun.c
Expand Up @@ -75,6 +75,7 @@ tvhdhomerun_device_class_override_enum( void * p )
htsmsg_t *m = htsmsg_create_list();
htsmsg_add_str(m, NULL, "DVB-T");
htsmsg_add_str(m, NULL, "DVB-C");
htsmsg_add_str(m, NULL, "ATSC");
return m;
}

Expand Down Expand Up @@ -239,7 +240,7 @@ static void tvhdhomerun_device_create(struct hdhomerun_discover_device_t *dInfo)
const char *override_type = htsmsg_get_str(conf, "fe_override");
if ( override_type != NULL) {
type = dvb_str2type(override_type);
if ( ! ( type == DVB_TYPE_C || type == DVB_TYPE_T ) ) {
if ( ! ( type == DVB_TYPE_C || type == DVB_TYPE_T || type == DVB_TYPE_ATSC ) ) {
type = DVB_TYPE_C;
}
}
Expand Down
16 changes: 15 additions & 1 deletion src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
Expand Up @@ -415,6 +415,8 @@ tvhdhomerun_frontend_network_list ( mpegts_input_t *mi )
idc = &dvb_network_dvbt_class;
else if (hfe->hf_type == DVB_TYPE_C)
idc = &dvb_network_dvbc_class;
else if (hfe->hf_type == DVB_TYPE_ATSC)
idc = &dvb_network_atsc_class;
else
return NULL;

Expand Down Expand Up @@ -486,6 +488,16 @@ const idclass_t tvhdhomerun_frontend_dvbc_class =
}
};

const idclass_t tvhdhomerun_frontend_atsc_class =
{
.ic_super = &tvhdhomerun_frontend_class,
.ic_class = "tvhdhomerun_frontend_atsc",
.ic_caption = "HDHomeRun ATSC Frontend",
.ic_properties = (const property_t[]){
{}
}
};

void
tvhdhomerun_frontend_delete ( tvhdhomerun_frontend_t *hfe )
{
Expand Down Expand Up @@ -532,7 +544,9 @@ tvhdhomerun_frontend_create(tvhdhomerun_device_t *hd, struct hdhomerun_discover_
idc = &tvhdhomerun_frontend_dvbt_class;
else if (type == DVB_TYPE_C)
idc = &tvhdhomerun_frontend_dvbc_class;
else {
else if (type == DVB_TYPE_ATSC) {
idc = &tvhdhomerun_frontend_atsc_class;
} else {
tvherror("stvhdhomerun", "unknown FE type %d", type);
return NULL;
}
Expand Down

0 comments on commit 24d2ab4

Please sign in to comment.