Skip to content

Commit

Permalink
MT#55283 fix RTCP/MOS reporting
Browse files Browse the repository at this point in the history
We always need to (re)set the ssrc_map_out SSRC, even for the input
context, as this SSRC is used to look up the receiving SSRC context,
where the appropriate RX stats are stored, including the payload type in
use.

Change-Id: I434c6df4761bf56e36c7267dd3a44b0bb9c9b852
  • Loading branch information
rfuchs committed Aug 18, 2023
1 parent 5f345ec commit 4cbc35e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions daemon/media_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,12 +2071,10 @@ static const char *__stream_ssrc_inout(struct packet_stream *ps, uint32_t ssrc,
ssrc_ctx_hold(*output);

// reverse SSRC mapping
if (dir == SSRC_DIR_OUTPUT) {
if (!output_ssrc)
(*output)->ssrc_map_out = ssrc;
else
(*output)->ssrc_map_out = output_ssrc;
}
if (!output_ssrc)
(*output)->ssrc_map_out = ssrc;
else
(*output)->ssrc_map_out = output_ssrc;

mutex_unlock(lock);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion daemon/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ static GString *rtcp_sender_report(struct ssrc_sender_report *ssr,
struct ssrc_receiver_report *srr = g_slice_alloc(sizeof(*srr));
*srr = (struct ssrc_receiver_report) {
.from = ssrc_out,
.ssrc = s->ssrc_map_out ? : s->parent->h.ssrc,
.ssrc = s->parent->h.ssrc,
.fraction_lost = lost * 256 / (tot + lost),
.packets_lost = lost,
.high_seq_received = atomic64_get(&s->last_seq),
Expand Down

0 comments on commit 4cbc35e

Please sign in to comment.