explicitly say if we are scanning when idle

This commit is contained in:
Andreas Öman 2007-11-21 09:48:40 +00:00
parent 5b1e6f67a9
commit edbd2481cb
5 changed files with 15 additions and 2 deletions

3
dvb.c
View file

@ -875,7 +875,6 @@ tdmi_initial_scan_timeout(void *aux, int64_t now)
th_dvb_mux_instance_t *tdmi = aux;
th_dvb_adapter_t *tda = tdmi->tdmi_adapter;
const char *err;
th_dvb_table_t *tdt;
dtimer_disarm(&tdmi->tdmi_initial_scan_timer);
@ -996,6 +995,6 @@ dvb_mux_scanner(void *aux, int64_t now)
if(tdmi == NULL)
return; /* no instances */
dvb_tune_tdmi(tdmi, 0, TDMI_RUNNING);
dvb_tune_tdmi(tdmi, 0, TDMI_IDLESCAN);
}

View file

@ -158,6 +158,11 @@ dvb_start_feed(th_transport_t *t, unsigned int weight)
if(tdmi->tdmi_state == TDMI_RUNNING)
goto gotmux;
if(tdmi->tdmi_state == TDMI_IDLESCAN) {
tdmi->tdmi_state = TDMI_RUNNING;
goto gotmux;
}
w = transport_compute_weight(&tdmi->tdmi_adapter->tda_transports);
if(w < weight && cand == NULL)
cand = tdmi;

View file

@ -841,6 +841,9 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
case TDMI_RUNNING:
txt = "Running";
break;
case TDMI_IDLESCAN:
txt = "IdleScan";
break;
}
tcp_qprintf(&tq,

View file

@ -168,6 +168,11 @@ print_tdmi(client_t *c, th_dvb_mux_instance_t *tdmi)
cprintf(c, "Running since %s", ctime(&tdmi->tdmi_got_adapter));
cprintf(c, "\t Current status: ");
break;
case TDMI_IDLESCAN:
cprintf(c, "Idle but scanning\n");
cprintf(c, "\t Current status: ");
break;
}
if(tdmi->tdmi_status != NULL) {

View file

@ -127,6 +127,7 @@ typedef enum {
TDMI_INITIAL_SCAN,
TDMI_IDLE,
TDMI_RUNNING,
TDMI_IDLESCAN,
} tdmi_state_t;
/*