413 |
413 |
break;
|
414 |
414 |
}
|
415 |
415 |
break;
|
|
416 |
case DVB_TYPE_ATSC_C:
|
|
417 |
snprintf(channel_buf, sizeof(channel_buf), "%u", dmc->dmc_fe_freq / 1000000);
|
|
418 |
break;
|
416 |
419 |
default:
|
417 |
420 |
snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
|
418 |
421 |
break;
|
... | ... | |
427 |
430 |
tvherror(LS_TVHDHOMERUN, "failed to acquire lockkey: %s", perror);
|
428 |
431 |
return SM_CODE_TUNING_FAILED;
|
429 |
432 |
}
|
430 |
|
res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
|
|
433 |
if (dmc->dmc_fe_type == DVB_TYPE_ATSC_C) {
|
|
434 |
res = hdhomerun_device_set_tuner_vchannel(hfe->hf_hdhomerun_tuner, channel_buf);
|
|
435 |
} else {
|
|
436 |
res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
|
|
437 |
}
|
431 |
438 |
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
|
432 |
439 |
if(res < 1) {
|
433 |
440 |
tvherror(LS_TVHDHOMERUN, "failed to tune to %s", channel_buf);
|
... | ... | |
459 |
466 |
res = tvhdhomerun_frontend_tune(hfe, mmi);
|
460 |
467 |
|
461 |
468 |
/* reset the pfilters */
|
462 |
|
pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
|
463 |
|
r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000");
|
464 |
|
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
|
465 |
|
if(r < 1)
|
466 |
|
tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r);
|
|
469 |
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
|
|
470 |
if (lm->lm_tuning.dmc_fe_type != DVB_TYPE_ATSC_C) {
|
|
471 |
pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
|
|
472 |
r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000");
|
|
473 |
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
|
|
474 |
if(r < 1)
|
|
475 |
tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r);
|
|
476 |
}
|
467 |
477 |
|
468 |
478 |
return res;
|
469 |
479 |
}
|