-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix transport-wide CC feedback when simulcast SSRCs are missing #2908
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3997,6 +3997,20 @@ static gboolean janus_ice_outgoing_transport_wide_cc_feedback(gpointer user_data | |
} | ||
|
||
if(pc && pc->do_transport_wide_cc && medium) { | ||
/* Simulcast layers that have not received data will not have a recorded peer SSRC. */ | ||
/* Pick the first layer that has a peer SSRC */ | ||
guint32 ssrc_peer = 0; | ||
for(int i = 0; i < 3; i++) { | ||
if(medium->ssrc_peer[i] != 0) { | ||
ssrc_peer = medium->ssrc_peer[i]; | ||
break; | ||
} | ||
} | ||
if (ssrc_peer == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code style: no space between |
||
JANUS_LOG(LOG_WARN, "No peer SSRC, cannot send transport-wide CC feedback\n"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't display a warning here: in case it happens, this is going to spam the logs a lot, since TWCC feedback is very frequent (5 to 10 times per second by default). I'd make it a |
||
return G_SOURCE_CONTINUE; | ||
} | ||
|
||
/* Create a transport wide feedback message */ | ||
size_t size = 1300; | ||
char rtcpbuf[1300]; | ||
|
@@ -4065,7 +4079,7 @@ static gboolean janus_ice_outgoing_transport_wide_cc_feedback(gpointer user_data | |
guint8 feedback_packet_count = pc->transport_wide_cc_feedback_count++; | ||
/* Create RTCP packet */ | ||
int len = janus_rtcp_transport_wide_cc_feedback(rtcpbuf, size, | ||
medium->ssrc, medium->ssrc_peer[0], feedback_packet_count, packets_to_process); | ||
medium->ssrc, ssrc_peer, feedback_packet_count, packets_to_process); | ||
/* Enqueue it, we'll send it later */ | ||
if(len > 0) { | ||
janus_plugin_rtcp rtcp = { .mindex = medium->mindex, .video = TRUE, .buffer = rtcpbuf, .length = len }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per code style, we don't define variables inside the
for
loop, so please definei
outside.