Add '-j <transportid>' option that performs a static subscription for a transport.
Useful when debugging.
This commit is contained in:
parent
ba15ac635c
commit
751ad9ad65
3 changed files with 42 additions and 1 deletions
|
@ -230,8 +230,9 @@ main(int argc, char **argv)
|
|||
const char *contentpath = TVHEADEND_CONTENT_PATH;
|
||||
const char *homedir = NULL;
|
||||
const char *rawts_input = NULL;
|
||||
const char *join_transport = NULL;
|
||||
|
||||
while((c = getopt(argc, argv, "fu:g:c:Chdr:")) != -1) {
|
||||
while((c = getopt(argc, argv, "fu:g:c:Chdr:j:")) != -1) {
|
||||
switch(c) {
|
||||
case 'f':
|
||||
forkaway = 1;
|
||||
|
@ -254,6 +255,9 @@ main(int argc, char **argv)
|
|||
case 'r':
|
||||
rawts_input = optarg;
|
||||
break;
|
||||
case 'j':
|
||||
join_transport = optarg;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
@ -347,6 +351,9 @@ main(int argc, char **argv)
|
|||
if(rawts_input != NULL)
|
||||
rawts_init(rawts_input);
|
||||
|
||||
if(join_transport != NULL)
|
||||
subscription_dummy_join(join_transport);
|
||||
|
||||
pthread_mutex_unlock(&global_lock);
|
||||
|
||||
|
||||
|
|
|
@ -255,3 +255,35 @@ subscription_create_from_transport(th_transport_t *t, const char *name,
|
|||
subscription_link_transport(s, t);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static void
|
||||
dummy_callback(void *opauqe, streaming_message_t *sm)
|
||||
{
|
||||
streaming_msg_free(sm);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void
|
||||
subscription_dummy_join(const char *id)
|
||||
{
|
||||
th_transport_t *t = transport_find_by_identifier(id);
|
||||
streaming_target_t *st;
|
||||
|
||||
if(t == NULL) {
|
||||
tvhlog(LOG_ERR, "subscription",
|
||||
"Unable to dummy join %s, transport not found", id);
|
||||
return;
|
||||
}
|
||||
|
||||
st = calloc(1, sizeof(streaming_target_t));
|
||||
streaming_target_init(st, dummy_callback, NULL);
|
||||
subscription_create_from_transport(t, "dummy", st);
|
||||
|
||||
}
|
||||
|
|
|
@ -66,4 +66,6 @@ void subscription_stop(th_subscription_t *s);
|
|||
|
||||
void subscription_unlink_transport(th_subscription_t *s);
|
||||
|
||||
void subscription_dummy_join(const char *id);
|
||||
|
||||
#endif /* SUBSCRIPTIONS_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue