diff --git a/ajaxui/ajaxui_config_dvb.c b/ajaxui/ajaxui_config_dvb.c index ef5cda2e..06f7bee8 100644 --- a/ajaxui/ajaxui_config_dvb.c +++ b/ajaxui/ajaxui_config_dvb.c @@ -540,7 +540,7 @@ ajax_adaptermuxlist(http_connection_t *hc, const char *remain, void *opaque) th_dvb_adapter_t *tda; char buf[50], buf2[500], buf3[20]; const char *txt; - int fetype, n; + int fetype, n, m; th_transport_t *t; int o = 1, v; int csize[10]; @@ -610,11 +610,13 @@ ajax_adaptermuxlist(http_connection_t *hc, const char *remain, void *opaque) cells[3] = txt; - n = 0; - LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) + n = m = 0; + LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) { n++; - - snprintf(buf3, sizeof(buf3), "%d", n); + if(transport_is_available(t)) + m++; + } + snprintf(buf3, sizeof(buf3), "%d / %d", m, n); cells[4] = buf3; cells[5] = NULL; @@ -658,9 +660,8 @@ ajax_dvbmuxeditor(http_connection_t *hc, const char *remain, void *opaque) LIST_INIT(&head); LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) { - if(transport_servicetype_txt(t) == NULL) - continue; - LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp); + if(transport_is_available(t)) + LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp); } ajax_box_begin(&tq, AJAX_BOX_SIDEBOX, NULL, NULL, buf); diff --git a/transports.c b/transports.c index 03ac77a6..db2a00bf 100644 --- a/transports.c +++ b/transports.c @@ -521,3 +521,12 @@ transport_is_tv(th_transport_t *t) t->tht_servicetype == ST_AC_SDTV || t->tht_servicetype == ST_AC_HDTV; } + +/** + * + */ +int +transport_is_available(th_transport_t *t) +{ + return transport_servicetype_txt(t) && LIST_FIRST(&t->tht_streams); +} diff --git a/transports.h b/transports.h index 64e0a496..29d61495 100644 --- a/transports.h +++ b/transports.h @@ -47,4 +47,6 @@ const char *transport_servicetype_txt(th_transport_t *t); int transport_is_tv(th_transport_t *t); +int transport_is_available(th_transport_t *t); + #endif /* TRANSPORTS_H */