Skip to content

Commit

Permalink
Test for a rejected or unknown code in subscription offer generation.
Browse files Browse the repository at this point in the history
A codec rejection generated by a publisher offer leaves a null
codec in the publisher stream description. Do not add to the sub offer.
  • Loading branch information
paulkerr-rbx committed Nov 8, 2023
1 parent 0ae1c6d commit 5fa3a71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5fa3a71

Please sign in to comment.