From 5fa3a7186110cf45d44e8884e81e72dcbdd341af Mon Sep 17 00:00:00 2001 From: Paul Kerr Date: Wed, 8 Nov 2023 11:22:02 -0800 Subject: [PATCH] Test for a rejected or unknown code in subscription offer generation. A codec rejection generated by a publisher offer leaves a null codec in the publisher stream description. Do not add to the sub offer. --- src/plugins/janus_videoroom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/janus_videoroom.c b/src/plugins/janus_videoroom.c index a9840e7494..1dbeb3e4c3 100644 --- a/src/plugins/janus_videoroom.c +++ b/src/plugins/janus_videoroom.c @@ -3162,6 +3162,12 @@ static json_t *janus_videoroom_subscriber_offer(janus_videoroom_subscriber *subs } } if(stream->type != JANUS_VIDEOROOM_MEDIA_DATA) { + if((stream->type == JANUS_VIDEOROOM_MEDIA_AUDIO && stream->acodec == JANUS_AUDIOCODEC_NONE) || + (stream->type == JANUS_VIDEOROOM_MEDIA_VIDEO && stream->vcodec == JANUS_VIDEOCODEC_NONE)) { + // Publisher stream codec unsupported or rejected. Do not add to the offer. + temp = temp->next; + continue; + } pt = stream->pt; codec = (stream->type == JANUS_VIDEOROOM_MEDIA_AUDIO ? janus_audiocodec_name(stream->acodec) : janus_videocodec_name(stream->vcodec));