]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsfile: Added option to allow a fixed UUID for tsfile muxes
authorAdam Sutton <dev@adamsutton.me.uk>
Mon, 21 Apr 2014 13:46:56 +0000 (14:46 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 21 Apr 2014 13:46:56 +0000 (14:46 +0100)
This is useful for testing how they work with other parts of the system

src/input/mpegts/tsfile/tsfile.c
src/input/mpegts/tsfile/tsfile_mux.c
src/input/mpegts/tsfile/tsfile_private.h

index ed4448e0010643c573983cb3ee386d23ff034fae..e11da667769915ced6d754b81eee13b65cbdd488 100644 (file)
@@ -110,10 +110,19 @@ void tsfile_add_file ( const char *path )
 {
   tsfile_input_t        *mi;
   mpegts_mux_t          *mm;
-  tvhtrace("tsfile", "add file %s", path);
+  char *uuid = NULL, *tok, *tmp = strdupa(path);
 
+  /* Pull UUID from info */
+  if ((tok = strstr(tmp, "::"))) {
+    *tok = '\0';
+    path = tok + 2;
+    uuid = tmp;
+  }
+
+  tvhtrace("tsfile", "add file %s (uuid:%s)", path, uuid);
+  
   /* Create logical instance */
-  mm = tsfile_mux_create(&tsfile_network);
+  mm = tsfile_mux_create(uuid, &tsfile_network);
   
   /* Create physical instance (for each tuner) */
   LIST_FOREACH(mi, &tsfile_inputs, tsi_link)
index d7664264ccbf63392a4b8f32bb6d642a028b14c8..c27a223288c2be74cf5bc0f329f38f1726a44134 100644 (file)
@@ -42,10 +42,10 @@ iptv_mux_config_save ( mpegts_mux_t *m )
 }
 
 mpegts_mux_t *
-tsfile_mux_create ( mpegts_network_t *mn )
+tsfile_mux_create ( const char *uuid, mpegts_network_t *mn )
 {
   mpegts_mux_t *mm 
-    = mpegts_mux_create1(NULL, mn, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, NULL);
+    = mpegts_mux_create1(uuid, mn, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE, NULL);
   mm->mm_config_save = iptv_mux_config_save;
   tvhtrace("tsfile", "mm created %p", mm);
   return mm;
index 7186955d62d39527a11151d3f367ae9e4adff1b6..739f6a126c4e4b303e995702f07671533ea525f0 100644 (file)
@@ -78,7 +78,7 @@ tsfile_mux_instance_t *tsfile_mux_instance_create
   ( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm );
 
 mpegts_mux_t *
-tsfile_mux_create ( mpegts_network_t *mn );
+tsfile_mux_create ( const char *uuid, mpegts_network_t *mn );
 
 #endif /* __TVH_TSFILE_PRIVATE_H__ */