Skip to content

Commit

Permalink
Fixed rare crash in VideoRoom when using SVC
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Apr 22, 2024
1 parent bc04499 commit 32aa5e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/janus_videoroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -12656,7 +12656,8 @@ static void janus_videoroom_relay_rtp_packet(gpointer data, gpointer user_data)
if(payload == NULL)
return;
/* Process this packet: don't relay if it's not the layer we wanted to handle */
janus_rtp_header rtp = *(packet->data);
char rtph[12];
memcpy(&rtph, packet->data, sizeof(rtph));
gboolean relay = janus_rtp_svc_context_process_rtp(&stream->svc_context,
(char *)packet->data, packet->length, packet->extensions.dd_content, packet->extensions.dd_len,
ps->vcodec, &packet->svc_info, &stream->context);
Expand Down Expand Up @@ -12702,7 +12703,7 @@ static void janus_videoroom_relay_rtp_packet(gpointer data, gpointer user_data)
gateway->relay_rtp(session->handle, &rtp);
}
/* Restore the timestamp and sequence number to what the publisher set them to */
*(packet->data) = rtp;
memcpy(packet->data, &rtph, sizeof(rtph));
} else if(packet->simulcast) {
/* Handle simulcast: make sure we have a payload to work with */
int plen = 0;
Expand Down

0 comments on commit 32aa5e6

Please sign in to comment.