pro = de->de_config->dvr_profile;
prch = malloc(sizeof(*prch));
- profile_chain_init(prch, pro, de->de_channel);
+ profile_chain_init(prch, pro, de->de_channel, 1);
if (profile_chain_open(prch, &de->de_config->dvr_muxcnf, NULL, 0, 0)) {
profile_chain_close(prch);
tvherror(LS_DVR, "unable to create new channel streaming chain '%s' for '%s', using default",
profile_get_name(pro), channel_get_name(de->de_channel, channel_blank_name));
pro = profile_find_by_name(NULL, NULL);
- profile_chain_init(prch, pro, de->de_channel);
+ profile_chain_init(prch, pro, de->de_channel, 1);
if (profile_chain_open(prch, &de->de_config->dvr_muxcnf, NULL, 0, 0)) {
tvherror(LS_DVR, "unable to create channel streaming default chain '%s' for '%s'",
profile_get_name(pro), channel_get_name(de->de_channel, channel_blank_name));
pro = profile_find_by_list(htsp->htsp_granted_access->aa_profiles, profile_id,
"htsp", SUBSCRIPTION_PACKET | SUBSCRIPTION_HTSP);
- profile_chain_init(&hs->hs_prch, pro, ch);
+ profile_chain_init(&hs->hs_prch, pro, ch, 1);
if (profile_chain_work(&hs->hs_prch, &hs->hs_input, timeshiftPeriod, 0)) {
tvherror(LS_HTSP, "unable to create profile chain '%s'", profile_get_name(pro));
profile_chain_close(&hs->hs_prch);
*
*/
void
-profile_chain_init(profile_chain_t *prch, profile_t *pro, void *id)
+profile_chain_init(profile_chain_t *prch, profile_t *pro, void *id, int queue)
{
memset(prch, 0, sizeof(*prch));
if (pro)
profile_grab(pro);
prch->prch_pro = pro;
prch->prch_id = id;
- streaming_queue_init(&prch->prch_sq, 0, 0);
- prch->prch_sq_used = 1;
+ if (queue) {
+ streaming_queue_init(&prch->prch_sq, 0, 0);
+ prch->prch_sq_used = 1;
+ }
LIST_INSERT_HEAD(&profile_chains, prch, prch_link);
prch->prch_linked = 1;
prch->prch_stop = 1;
muxer_config_t *m_cfg,
muxer_hints_t *hints,
int flags, size_t qsize);
-void profile_chain_init(profile_chain_t *prch, profile_t *pro, void *id);
+void profile_chain_init(profile_chain_t *prch, profile_t *pro, void *id, int queue);
int profile_chain_raw_open(profile_chain_t *prch, void *id, size_t qsize, int muxer);
void profile_chain_close(profile_chain_t *prch);
int profile_chain_weight(profile_chain_t *prch, int custom);
pthread_mutex_unlock(&master->s_stream_mutex);
master->s_link(master, slave);
sub->service = slave;
- profile_chain_init(&sub->prch, NULL, NULL);
- sub->prch.prch_st = &sub->prch.prch_sq.sq_st;
- sub->prch.prch_id = slave;
+ profile_chain_init(&sub->prch, NULL, slave, 0);
snprintf(buf, sizeof(buf), "SAT>IP Slave/%s", slave->s_nicename);
sub->ths = subscription_create_from_service(&sub->prch, NULL,
SUBSCRIPTION_NONE,
const char *err = NULL;
uint64_t timeout, timeout_other;
- profile_chain_init(&prch, NULL, NULL);
+ profile_chain_init(&prch, NULL, NULL, 1);
prch.prch_st = &prch.prch_sq.sq_st;
sq = &prch.prch_sq;
const char *client,
int *error)
{
- assert(prch->prch_st);
+ assert(flags == SUBSCRIPTION_NONE || prch->prch_st);
return subscription_create_from_channel_or_service
(prch, ti, weight, name, flags, hostname, username, client,
error, NULL);
const char *client,
int *error)
{
- assert(prch->prch_st);
+ assert(flags == SUBSCRIPTION_NONE || prch->prch_st);
return subscription_create_from_channel_or_service
(prch, ti, weight, name, flags, hostname, username, client,
error, prch->prch_id);
hints = muxer_hints_create(http_arg_get(&hc->hc_args, "User-Agent"));
- profile_chain_init(&prch, pro, service);
+ profile_chain_init(&prch, pro, service, 1);
if (!profile_chain_open(&prch, NULL, hints, 0, qsize)) {
s = subscription_create_from_service(&prch, NULL, weight, "HTTP",
hints = muxer_hints_create(http_arg_get(&hc->hc_args, "User-Agent"));
- profile_chain_init(&prch, pro, ch);
+ profile_chain_init(&prch, pro, ch, 1);
if (!profile_chain_open(&prch, NULL, hints, 0, qsize)) {
s = subscription_create_from_channel(&prch,