From 4536719d12238ab8fd571865c8b0ec5fef89ffe1 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Mon, 21 Apr 2014 14:46:56 +0100 Subject: [PATCH] tsfile: Added option to allow a fixed UUID for tsfile muxes This is useful for testing how they work with other parts of the system --- src/input/mpegts/tsfile/tsfile.c | 13 +++++++++++-- src/input/mpegts/tsfile/tsfile_mux.c | 4 ++-- src/input/mpegts/tsfile/tsfile_private.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/input/mpegts/tsfile/tsfile.c b/src/input/mpegts/tsfile/tsfile.c index ed4448e0..e11da667 100644 --- a/src/input/mpegts/tsfile/tsfile.c +++ b/src/input/mpegts/tsfile/tsfile.c @@ -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) diff --git a/src/input/mpegts/tsfile/tsfile_mux.c b/src/input/mpegts/tsfile/tsfile_mux.c index d7664264..c27a2232 100644 --- a/src/input/mpegts/tsfile/tsfile_mux.c +++ b/src/input/mpegts/tsfile/tsfile_mux.c @@ -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; diff --git a/src/input/mpegts/tsfile/tsfile_private.h b/src/input/mpegts/tsfile/tsfile_private.h index 7186955d..739f6a12 100644 --- a/src/input/mpegts/tsfile/tsfile_private.h +++ b/src/input/mpegts/tsfile/tsfile_private.h @@ -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__ */