]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tvhdhomerun: add modulation and symbolrate to channel tuning
authorberalt <beralt@beralt.nl>
Wed, 28 Jan 2015 12:18:37 +0000 (13:18 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 28 Jan 2015 20:00:11 +0000 (21:00 +0100)
src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c

index fbe90a08ef6a71ec17c327b9b029c8d24a5860c8..8a75dcbdd583c7d2cb97bacbc665f69a444d57a5 100644 (file)
@@ -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);