--- a/src/input/mpegts/tvhdhomerun/tvhdhomerun.c +++ b/src/input/mpegts/tvhdhomerun/tvhdhomerun.c @@ -301,6 +301,8 @@ } else { if (strstr(hd->hd_info.deviceModel, "_atsc")) type = DVB_TYPE_ATSC_T; + if (strstr(hd->hd_info.deviceModel, "_cablecard")) + type = DVB_TYPE_ATSC_C; } hd->hd_override_type = strdup(dvb_type2str(type)); --- a/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c +++ b/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c @@ -307,6 +307,9 @@ char *pfilter; char buf[1024]; int res; + + if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) + return; /* a full mux subscription should specificly set the filter */ if (pid == MPEGTS_FULLMUX_PID) { @@ -413,6 +416,11 @@ break; } break; + case DVB_TYPE_ATSC_C: + if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) { + snprintf(channel_buf, sizeof(channel_buf), "%u", dmc->dmc_fe_freq / 1000000); + break; + } default: snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq); break; @@ -427,7 +435,10 @@ tvherror(LS_TVHDHOMERUN, "failed to acquire lockkey: %s", perror); return SM_CODE_TUNING_FAILED; } - res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf); + if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) + res = hdhomerun_device_set_tuner_vchannel(hfe->hf_hdhomerun_tuner, channel_buf); + else + res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf); pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex); if(res < 1) { tvherror(LS_TVHDHOMERUN, "failed to tune to %s", channel_buf); @@ -448,7 +459,7 @@ ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi, int weight ) { tvhdhomerun_frontend_t *hfe = (tvhdhomerun_frontend_t*)mi; - int res, r; + int res; char buf1[256], buf2[256]; mi->mi_display_name(mi, buf1, sizeof(buf1)); @@ -458,13 +469,15 @@ /* tune to the right mux */ res = tvhdhomerun_frontend_tune(hfe, mmi); - /* reset the pfilters */ - pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex); - r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000"); - pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex); - if(r < 1) - tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r); - + if (!strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) { + /* reset the pfilters */ + int r; + pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex); + r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000"); + pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex); + if(r < 1) + tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r); + } return res; }