]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP: Do not ignore the "enabled checkbox" in the DVB-S position settings
authorJaroslav Kysela <perex@perex.cz>
Sat, 17 May 2014 16:48:01 +0000 (18:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 17 May 2014 16:50:53 +0000 (18:50 +0200)
src/input/mpegts/satip/satip_frontend.c
src/input/mpegts/satip/satip_satconf.c

index 5034c482bb8c4ec64a9e3611c74b280c9d189655..de3d5a29b353e273021686fe31074fb7574b0e2e 100644 (file)
@@ -336,7 +336,7 @@ satip_frontend_match_satcfg ( satip_frontend_t *lfe2, mpegts_mux_t *mm2 )
     return 0;
   mm1 = lfe2->sf_mmi->mmi_mux;
   position = satip_satconf_get_position(lfe2, mm2);
-  if (lfe2->sf_position != position)
+  if (position <= 0 || lfe2->sf_position != position)
     return 0;
   mc1 = &((dvb_mux_t *)mm1)->lm_tuning;
   mc2 = &((dvb_mux_t *)mm2)->lm_tuning;
@@ -356,11 +356,16 @@ satip_frontend_is_enabled ( mpegts_input_t *mi, mpegts_mux_t *mm )
 {
   satip_frontend_t *lfe = (satip_frontend_t*)mi;
   satip_frontend_t *lfe2;
+  int position;
 
   lock_assert(&global_lock);
 
   if (!lfe->mi_enabled) return 0;
   if (lfe->sf_type != DVB_TYPE_S) return 1;
+  /* check if the position is enabled */
+  position = satip_satconf_get_position(lfe, mm);
+  if (position <= 0)
+    return 0;
   /* check if any "blocking" tuner is running */
   TAILQ_FOREACH(lfe2, &lfe->sf_device->sd_frontends, sf_link) {
     if (lfe2 == lfe) continue;
@@ -418,8 +423,11 @@ satip_frontend_start_mux
   ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
 {
   satip_frontend_t *lfe = (satip_frontend_t*)mi;
-  if (lfe->sf_positions > 0)
+  if (lfe->sf_positions > 0) {
     lfe->sf_position = satip_satconf_get_position(lfe, mmi->mmi_mux);
+    if (lfe->sf_position <= 0)
+      return SM_CODE_TUNING_FAILED;
+  }
   return satip_frontend_tune1((satip_frontend_t*)mi, mmi);
 }
 
index 5e2a2b088fa218be8c80a7a0014a3c21e485b03b..97f6edb5e13468b9cbdb2834bd2f707d357d7a3b 100644 (file)
@@ -49,7 +49,7 @@ satip_satconf_get_position
   ( satip_frontend_t *lfe, mpegts_mux_t *mm )
 {
   satip_satconf_t *sfc = satip_satconf_find_ele(lfe, mm);
-  return sfc ? sfc->sfc_position : 0;
+  return sfc && sfc->sfc_enabled ? sfc->sfc_position : 0;
 }
 
 /* **************************************************************************