--- a/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c +++ b/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c @@ -413,6 +413,9 @@ break; } break; + case DVB_TYPE_ATSC_C: + 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 +430,11 @@ 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 (dmc->dmc_fe_type == DVB_TYPE_ATSC_C) { + 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); @@ -459,11 +466,14 @@ 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); + dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux; + if (lm->lm_tuning.dmc_fe_type != DVB_TYPE_ATSC_C) { + 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; }