]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Make sure services always appear in the same order by sorting them.
authorAndreas Öman <andreas@lonelycoder.com>
Mon, 7 Apr 2008 21:00:12 +0000 (21:00 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Mon, 7 Apr 2008 21:00:12 +0000 (21:00 +0000)
ajaxui/ajaxui_config_dvb.c

index 6c66bc30164059c8f45c58128e6ba7e008f0a55b..8c4b2e377b139d86ad0e0b04bba5b74532e6bb22 100644 (file)
@@ -606,6 +606,15 @@ ajax_adaptermuxlist(http_connection_t *hc, const char *remain, void *opaque)
   return 0;
 }
 
+/**
+ *
+ */
+static int
+dvbsvccmp(th_transport_t *a, th_transport_t *b)
+{
+  return a->tht_dvb_service_id - b->tht_dvb_service_id;
+}
+
 /**
  * Display detailes about a mux
  */
@@ -630,7 +639,7 @@ ajax_dvbmuxeditor(http_connection_t *hc, const char *remain, void *opaque)
   LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) {
     if(transport_servicetype_txt(t) == NULL)
       continue;
-    LIST_INSERT_HEAD(&head, t, tht_tmp_link);
+    LIST_INSERT_SORTED(&head, t, tht_tmp_link, dvbsvccmp);
   }
 
   ajax_box_begin(&tq, AJAX_BOX_SIDEBOX, NULL, NULL, buf);