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
This commit is contained in:
Adam Sutton 2014-04-21 14:46:56 +01:00
parent ec81b4c98b
commit 4536719d12
3 changed files with 14 additions and 5 deletions

View 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)

View 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;

View 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__ */