301 |
301 |
} else {
|
302 |
302 |
if (strstr(hd->hd_info.deviceModel, "_atsc"))
|
303 |
303 |
type = DVB_TYPE_ATSC_T;
|
|
304 |
if (strstr(hd->hd_info.deviceModel, "_cablecard"))
|
|
305 |
type = DVB_TYPE_ATSC_C;
|
304 |
306 |
}
|
305 |
307 |
|
306 |
308 |
hd->hd_override_type = strdup(dvb_type2str(type));
|
307 |
|
-- a/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
|
|
309 |
++ b/src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
|
... | ... | |
307 |
307 |
char *pfilter;
|
308 |
308 |
char buf[1024];
|
309 |
309 |
int res;
|
|
310 |
|
|
311 |
if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard"))
|
|
312 |
return;
|
310 |
313 |
|
311 |
314 |
/* a full mux subscription should specificly set the filter */
|
312 |
315 |
if (pid == MPEGTS_FULLMUX_PID) {
|
... | ... | |
413 |
416 |
break;
|
414 |
417 |
}
|
415 |
418 |
break;
|
|
419 |
case DVB_TYPE_ATSC_C:
|
|
420 |
if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) {
|
|
421 |
snprintf(channel_buf, sizeof(channel_buf), "%u", dmc->dmc_fe_freq / 1000000);
|
|
422 |
break;
|
|
423 |
}
|
416 |
424 |
default:
|
417 |
425 |
snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
|
418 |
426 |
break;
|
... | ... | |
427 |
435 |
tvherror(LS_TVHDHOMERUN, "failed to acquire lockkey: %s", perror);
|
428 |
436 |
return SM_CODE_TUNING_FAILED;
|
429 |
437 |
}
|
430 |
|
res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
|
|
438 |
if (strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard"))
|
|
439 |
res = hdhomerun_device_set_tuner_vchannel(hfe->hf_hdhomerun_tuner, channel_buf);
|
|
440 |
else
|
|
441 |
res = hdhomerun_device_set_tuner_channel(hfe->hf_hdhomerun_tuner, channel_buf);
|
431 |
442 |
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
|
432 |
443 |
if(res < 1) {
|
433 |
444 |
tvherror(LS_TVHDHOMERUN, "failed to tune to %s", channel_buf);
|
... | ... | |
448 |
459 |
( mpegts_input_t *mi, mpegts_mux_instance_t *mmi, int weight )
|
449 |
460 |
{
|
450 |
461 |
tvhdhomerun_frontend_t *hfe = (tvhdhomerun_frontend_t*)mi;
|
451 |
|
int res, r;
|
|
462 |
int res;
|
452 |
463 |
char buf1[256], buf2[256];
|
453 |
464 |
|
454 |
465 |
mi->mi_display_name(mi, buf1, sizeof(buf1));
|
... | ... | |
458 |
469 |
/* tune to the right mux */
|
459 |
470 |
res = tvhdhomerun_frontend_tune(hfe, mmi);
|
460 |
471 |
|
461 |
|
/* 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);
|
467 |
|
|
|
472 |
if (!strstr(hfe->hf_device->hd_info.deviceModel, "_cablecard")) {
|
|
473 |
/* reset the pfilters */
|
|
474 |
int r;
|
|
475 |
pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
|
|
476 |
r = hdhomerun_device_set_tuner_filter(hfe->hf_hdhomerun_tuner, "0x0000");
|
|
477 |
pthread_mutex_unlock(&hfe->hf_hdhomerun_device_mutex);
|
|
478 |
if(r < 1)
|
|
479 |
tvherror(LS_TVHDHOMERUN, "failed to reset pfilter: %d", r);
|
|
480 |
}
|
468 |
481 |
return res;
|
469 |
482 |
}
|
470 |
483 |
|