From 93749c92437b0c375ddc6d72141520bd188319f0 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Wed, 29 Nov 2023 19:04:33 +0100 Subject: [PATCH] Don't create subscriptions to publisher streams with no codecs (see #3260) --- src/plugins/janus_videoroom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/janus_videoroom.c b/src/plugins/janus_videoroom.c index a9840e7494..e11a8733e1 100644 --- a/src/plugins/janus_videoroom.c +++ b/src/plugins/janus_videoroom.c @@ -10528,6 +10528,11 @@ static void *janus_videoroom_handler(void *data) { JANUS_LOG(LOG_WARN, "Skipping disabled m-line...\n"); continue; } + if((ps->type == JANUS_VIDEOROOM_MEDIA_AUDIO && ps->acodec == JANUS_AUDIOCODEC_NONE) || + (ps->type == JANUS_VIDEOROOM_MEDIA_VIDEO && ps->vcodec == JANUS_VIDEOCODEC_NONE)) { + JANUS_LOG(LOG_WARN, "Skipping rejected publisher stream...\n"); + continue; + } janus_videoroom_subscriber_stream *stream = janus_videoroom_subscriber_stream_add_or_replace(subscriber, ps, crossrefid); if(stream) { changes++; @@ -10591,6 +10596,11 @@ static void *janus_videoroom_handler(void *data) { temp = temp->next; continue; } + if((ps->type == JANUS_VIDEOROOM_MEDIA_AUDIO && ps->acodec == JANUS_AUDIOCODEC_NONE) || + (ps->type == JANUS_VIDEOROOM_MEDIA_VIDEO && ps->vcodec == JANUS_VIDEOCODEC_NONE)) { + JANUS_LOG(LOG_WARN, "Skipping rejected publisher stream...\n"); + continue; + } janus_videoroom_subscriber_stream *stream = janus_videoroom_subscriber_stream_add_or_replace(subscriber, ps, crossrefid); if(stream) { changes++;