]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Only display transports which are really available to us
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 9 Apr 2008 15:54:55 +0000 (15:54 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 9 Apr 2008 15:54:55 +0000 (15:54 +0000)
ajaxui/ajaxui_config_dvb.c
transports.c
transports.h

index ef5cda2e47219c7441e803e1d600cff2789317b8..06f7bee83b10f77e135a126cd4fb6d63968d612a 100644 (file)
@@ -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);
index 03ac77a68b06f6f8752fcd78168976479a719e59..db2a00bf3d4823917ce2dad661ed81e3af28bbe5 100644 (file)
@@ -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);
+}
index 64e0a496a3575f095d582099ee68e1699fa9de4b..29d614950cd8c6ed2073104564c67e2c9ba2cb31 100644 (file)
@@ -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 */