Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tvhdhomerun: add modulation and symbolrate to channel tuning
  • Loading branch information
beralt authored and perexg committed Jan 28, 2015
1 parent e6d124d commit 5eca4d7
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
Expand Up @@ -366,9 +366,31 @@ static int tvhdhomerun_frontend_tune(tvhdhomerun_frontend_t *hfe, mpegts_mux_ins
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
dvb_mux_conf_t *dmc = &lm->lm_tuning;
char channel_buf[64];
uint32_t symbol_rate = 0;
int res;

snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
/* resolve the modulation type */
switch (dmc->dmc_fe_type) {
case DVB_TYPE_C:
/* the symbol rate */
symbol_rate = dmc->u.dmc_fe_qam.symbol_rate / 1000;
switch(dmc->dmc_fe_modulation) {
case DVB_MOD_QAM_64:
snprintf(channel_buf, sizeof(channel_buf), "a8qam64-%d:%u", symbol_rate, dmc->dmc_fe_freq);
break;
case DVB_MOD_QAM_256:
snprintf(channel_buf, sizeof(channel_buf), "a8qam256-%d:%u", symbol_rate, dmc->dmc_fe_freq);
break;
default:
snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
break;
}
break;
default:
snprintf(channel_buf, sizeof(channel_buf), "auto:%u", dmc->dmc_fe_freq);
break;
}

tvhlog(LOG_INFO, "tvhdhomerun", "tuning to %s", channel_buf);

pthread_mutex_lock(&hfe->hf_hdhomerun_device_mutex);
Expand Down

0 comments on commit 5eca4d7

Please sign in to comment.