From 5f46145970b9e9e445a6ce4806d189940acd61ce Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Wed, 17 Jun 2020 13:16:36 +0200 Subject: [PATCH] Reset simulcast/SVC properties when switching in VideoRoom --- plugins/janus_videoroom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c index 59f75cf00c..93f05696a4 100644 --- a/plugins/janus_videoroom.c +++ b/plugins/janus_videoroom.c @@ -8806,6 +8806,16 @@ static void *janus_videoroom_handler(void *data) { ps->subscribers = g_slist_append(ps->subscribers, stream); janus_refcount_increase(&ps->ref); janus_refcount_increase(&stream->ref); + /* Reset simulcast and SVC properties too */ + janus_rtp_simulcasting_context_reset(&stream->sim_context); + stream->sim_context.rid_ext_id = ps->rid_extmap_id; + stream->sim_context.substream_target = 2; + stream->sim_context.templayer_target = 2; + janus_vp8_simulcast_context_reset(&stream->vp8_context); + stream->spatial_layer = -1; + stream->target_spatial_layer = 1; /* FIXME Chrome sends 0 and 1 */ + stream->temporal_layer = -1; + stream->target_temporal_layer = 2; /* FIXME Chrome sends 0, 1 and 2 */ janus_mutex_unlock(&ps->subscribers_mutex); janus_videoroom_reqpli(ps, "Subscriber switch"); if(unref)