From 5084ca63fdd43603fcef0f869075563c4dccab3d Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Wed, 25 Jul 2012 15:18:46 +0100 Subject: [PATCH] Reject muxes that fail to tune (almost always out of range due to bad autodiscovery) and ensure this is also locked in initial scan stats. --- src/dvb/dvb_fe.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dvb/dvb_fe.c b/src/dvb/dvb_fe.c index 9e7b7890..e122b1c3 100644 --- a/src/dvb/dvb_fe.c +++ b/src/dvb/dvb_fe.c @@ -496,6 +496,15 @@ dvb_fe_tune(th_dvb_mux_instance_t *tdmi, const char *reason) tvhlog(LOG_ERR, "dvb", "\"%s\" tuning to \"%s\"" " -- Front configuration failed -- %s, frequency: %ld", tda->tda_rootpath, buf, strerror(errno), p->frequency); + + /* Remove from initial scan set */ + if(tdmi->tdmi_table_initial) { + tdmi->tdmi_table_initial = 0; + tda->tda_initial_num_mux--; + } + + /* Mark as bad */ + tdmi->tdmi_enabled = 0; return SM_CODE_TUNING_FAILED; }