]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvb: undo mod to frequency range testing and add additional tuning check
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 18 Jan 2013 15:55:29 +0000 (15:55 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 18 Jan 2013 15:59:36 +0000 (15:59 +0000)
The previous check was garbage because for -S adapters the frequency range
reported by the adapter is in local units (i.e. hi/low band taken into
account) and not simple kHz. This makes checking more difficult and while
its possible I think this should be left for dvb rewrite.

Instead I've re-instated the old code, but muxes are only disable if the
return is EINVAL, which should only be returned if the DVB layer decides
the params are out of range.

src/dvb/dvb_fe.c
src/dvb/dvb_multiplex.c

index b1f9a3147fa50e617abccb418766ac073a126a20..a4e580899473e6f6f6bb0f56226be7c5a7f312a5 100644 (file)
@@ -510,6 +510,8 @@ dvb_fe_tune(th_dvb_mux_instance_t *tdmi, const char *reason)
     }
 
     /* Mark as bad */
+    if (errno == EINVAL)
+      dvb_mux_set_enable(tdmi, 0);
     return SM_CODE_TUNING_FAILED;
   }   
 
index 74c07341f72774f030eb60cb9fe5f91afd5188a8..37d3ca1721b43ee437eb961b1bde6802fa9ce245 100644 (file)
@@ -162,14 +162,6 @@ dvb_mux_create(th_dvb_adapter_t *tda, const struct dvb_mux_conf *dmc,
 
   lock_assert(&global_lock);
 
-  /* Reject out of range */
-  if ((dmc->dmc_fe_params.frequency < tda->tda_fe_info->frequency_min) ||
-      (dmc->dmc_fe_params.frequency > tda->tda_fe_info->frequency_max)) {
-    tvhlog(LOG_DEBUG, "dvb", "mux rejected with frequency %d",
-           dmc->dmc_fe_params.frequency);
-    return NULL;
-  }
-
   /* HACK - we hash/compare based on 2KHz spacing and compare on +/-500Hz */
   LIST_FOREACH(tdmi, &tda->tda_mux_list, tdmi_adapter_hash_link) {
     if(tdmi_compare_key(&tdmi->tdmi_conf, dmc))
@@ -1179,7 +1171,7 @@ dvb_mux_add_by_params(th_dvb_adapter_t *tda,
   tdmi = dvb_mux_create(tda, &dmc, 0, 0xffff, NULL, NULL, 1, 1, NULL, NULL);
 
   if(tdmi == NULL)
-    return "Mux already exists or bad parameters";
+    return "Mux already exist";
 
   return NULL;
 }