From af9c189a51ffd36691597b45e0b6a3e96d424771 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 7 Nov 2018 22:48:55 +0100 Subject: [PATCH] satip server: fix the weight handling for the scrambled slave subscriptions, fixes #5314 --- src/satip/rtsp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 701dd9a2d..1cd905d0c 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -334,9 +334,8 @@ rtsp_slave_add sub->service = 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, - buf, 0, NULL, NULL, + sub->ths = subscription_create_from_service(&sub->prch, NULL, rs->used_weight, + buf, SUBSCRIPTION_NONE, NULL, NULL, buf, NULL); if (sub->ths == NULL) { tvherror(LS_SATIPS, "%i/%s/%i: unable to subscribe service %s\n", @@ -530,6 +529,7 @@ rtsp_start mpegts_mux_t *mux; mpegts_service_t *svc; dvb_mux_conf_t dmc; + slave_subscription_t *sub; char buf[384]; int res = HTTP_STATUS_NOT_ALLOWED, qsize = 3000000, created = 0, weight; @@ -636,8 +636,11 @@ pids: svc = (mpegts_service_t *)rs->subs->ths_raw_service; svc->s_update_pids(svc, &rs->pids); satip_rtp_update_pids(rs->rtp_handle, &rs->pids); - if (rs->used_weight != weight && weight > 0) + if (rs->used_weight != weight && weight > 0) { subscription_set_weight(rs->subs, rs->used_weight = weight); + LIST_FOREACH(sub, &rs->slaves, link) + subscription_set_weight(sub->ths, weight); + } } if (cmd != RTSP_CMD_DESCRIBE && rs->rtp_handle == NULL) { if (rs->mux == NULL) -- 2.47.2