fix initial scanning bugs when having multiple adapters on the same network
scrap much of the tda_name logging, it's uninteresting
This commit is contained in:
parent
e798a8add7
commit
5b1e6f67a9
4 changed files with 27 additions and 21 deletions
36
dvb.c
36
dvb.c
|
@ -158,7 +158,7 @@ dvb_add_adapter(const char *path)
|
|||
LIST_INSERT_HEAD(&dvb_adapters_probing, tda, tda_link);
|
||||
startupcounter++;
|
||||
|
||||
tda->tda_name = strdup(tda->tda_fe_info.name);
|
||||
tda->tda_info = strdup(tda->tda_fe_info.name);
|
||||
|
||||
dispatch_addfd(tda->tda_fe_fd, dvb_frontend_event, tda, DISPATCH_PRI);
|
||||
|
||||
|
@ -189,7 +189,7 @@ dvb_init(void)
|
|||
if(tdmi == NULL) {
|
||||
syslog(LOG_WARNING,
|
||||
"No muxes configured on \"%s\" DVB adapter unused",
|
||||
tda->tda_name);
|
||||
tda->tda_path);
|
||||
} else {
|
||||
dvb_start_initial_scan(tdmi);
|
||||
}
|
||||
|
@ -299,15 +299,15 @@ dvb_tune_tdmi(th_dvb_mux_instance_t *tdmi, int maylog, tdmi_state_t state)
|
|||
tdmi->tdmi_state = state;
|
||||
|
||||
if(maylog)
|
||||
syslog(LOG_DEBUG, "%s (%s) tuning to mux \"%s\"",
|
||||
tda->tda_name, tda->tda_path, tdmi->tdmi_mux->tdm_title);
|
||||
syslog(LOG_DEBUG, "\"%s\" tuning to mux \"%s\"",
|
||||
tda->tda_path, tdmi->tdmi_mux->tdm_title);
|
||||
|
||||
i = ioctl(tda->tda_fe_fd, FE_SET_FRONTEND, &tdm->tdm_fe_params);
|
||||
if(i != 0) {
|
||||
if(maylog)
|
||||
syslog(LOG_ERR, "%s (%s) tuning to transport \"%s\""
|
||||
syslog(LOG_ERR, "\"%s\" tuning to transport \"%s\""
|
||||
" -- Front configuration failed -- %s",
|
||||
tda->tda_name, tda->tda_path, tdm->tdm_title,
|
||||
tda->tda_path, tdm->tdm_title,
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
@ -794,10 +794,15 @@ dvb_sdt_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len,
|
|||
transport_stream_id,
|
||||
service_id, 1);
|
||||
|
||||
if(LIST_FIRST(&t->tht_streams) != NULL && t->tht_channel == NULL) {
|
||||
transport_set_channel(t, channel_find(chname, 1));
|
||||
} else {
|
||||
ret |= 1;
|
||||
if(t->tht_channel == NULL) {
|
||||
/* Not yet mapped to a channel */
|
||||
if(LIST_FIRST(&t->tht_streams) != NULL) {
|
||||
/* We have seen a PMT (streams are created), map it */
|
||||
transport_set_channel(t, channel_find(chname, 1));
|
||||
} else {
|
||||
/* Return error (so scanning wont continue yet) */
|
||||
ret |= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -853,7 +858,7 @@ tdmi_activate(th_dvb_mux_instance_t *tdmi)
|
|||
startupcounter--;
|
||||
syslog(LOG_INFO,
|
||||
"\"%s\" Initial scan completed, adapter available",
|
||||
tda->tda_name);
|
||||
tda->tda_path);
|
||||
/* no more muxes to probe, link adapter to the world */
|
||||
LIST_REMOVE(tda, tda_link);
|
||||
LIST_INSERT_HEAD(&dvb_adapters_running, tda, tda_link);
|
||||
|
@ -870,16 +875,17 @@ 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);
|
||||
|
||||
if(tdmi->tdmi_status != NULL)
|
||||
err = tdmi->tdmi_status;
|
||||
else
|
||||
err = "No signal";
|
||||
err = "Missing PSI tables, scan will continue";
|
||||
|
||||
syslog(LOG_DEBUG, "\"%s\" on \"%s\" Initial scan timed out -- %s",
|
||||
tdmi->tdmi_mux->tdm_name, tda->tda_name, err);
|
||||
syslog(LOG_DEBUG, "\"%s\" mux \"%s\" Initial scan timed out -- %s",
|
||||
tda->tda_path, tdmi->tdmi_mux->tdm_name, err);
|
||||
|
||||
tdmi_activate(tdmi);
|
||||
}
|
||||
|
@ -903,7 +909,7 @@ tdmi_check_scan_status(th_dvb_mux_instance_t *tdmi)
|
|||
/* All tables seen at least once */
|
||||
|
||||
syslog(LOG_DEBUG, "\"%s\" on \"%s\" Initial scan completed",
|
||||
tdmi->tdmi_mux->tdm_name, tda->tda_name);
|
||||
tda->tda_path, tdmi->tdmi_mux->tdm_name);
|
||||
|
||||
tdmi_activate(tdmi);
|
||||
}
|
||||
|
|
6
htmlui.c
6
htmlui.c
|
@ -810,7 +810,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
|
|||
tcp_qprintf(&tq, "No DVB adapters configured<br>");
|
||||
} else {
|
||||
LIST_FOREACH(tda, &dvb_adapters_running, tda_link) {
|
||||
tcp_qprintf(&tq, "<br>%s<br>", tda->tda_path, tda->tda_name);
|
||||
tcp_qprintf(&tq, "<br>%s<br>%s<br>", tda->tda_path, tda->tda_info);
|
||||
LIST_FOREACH(tdmi, &tda->tda_muxes_active, tdmi_adapter_link) {
|
||||
|
||||
tcp_qprintf(&tq,
|
||||
|
@ -826,7 +826,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
|
|||
|
||||
tcp_qprintf(&tq,
|
||||
"<span style=\"overflow: hidden; height: 15px; "
|
||||
"width: 110px; float: left\">"
|
||||
"width: 120px; float: left\">"
|
||||
"%s"
|
||||
"</span>",
|
||||
txt);
|
||||
|
@ -845,7 +845,7 @@ page_status(http_connection_t *hc, const char *remain, void *opaque)
|
|||
|
||||
tcp_qprintf(&tq,
|
||||
"<span style=\"overflow: hidden; height: 15px; "
|
||||
"width: 70px; float: left\">"
|
||||
"width: 60px; float: left\">"
|
||||
"%s"
|
||||
"</span>",
|
||||
txt);
|
||||
|
|
|
@ -911,7 +911,7 @@ client_status_update(void *aux, int64_t now)
|
|||
"uncorrected-blocks = %d\n"
|
||||
"rate = %d\n"
|
||||
"cc-errors = %d\n",
|
||||
tda->tda_name,
|
||||
tda->tda_path,
|
||||
t->tht_name,
|
||||
tdmi->tdmi_uncorrected_blocks,
|
||||
rate, ccerr);
|
||||
|
@ -924,7 +924,7 @@ client_status_update(void *aux, int64_t now)
|
|||
"adapter = %s\n"
|
||||
"transport = %s\n",
|
||||
tdmi->tdmi_status,
|
||||
tda->tda_name,
|
||||
tda->tda_path,
|
||||
t->tht_name);
|
||||
}
|
||||
break;
|
||||
|
|
2
tvhead.h
2
tvhead.h
|
@ -201,7 +201,7 @@ typedef struct th_dvb_adapter {
|
|||
th_dvb_mux_instance_t *tda_mux_current;
|
||||
|
||||
const char *tda_path;
|
||||
const char *tda_name;
|
||||
const char *tda_info;
|
||||
|
||||
LIST_ENTRY(th_dvb_adapter) tda_link;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue