mgcp/rtp: Change the log message shown when the SSRC changes

Show old and new SSRC. Move logging command upward to show the values
immediately after the change has been detected and before any fixing
attempt is made.

Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2013-12-05 12:20:05 +01:00
parent db2d431697
commit 5e9549e6a9
1 changed files with 9 additions and 7 deletions

View File

@ -249,6 +249,15 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
endp->conn_mode);
} else if (state->in_stream.ssrc != rtp_hdr->ssrc) {
int32_t tsdelta = state->out_stream.last_tsdelta;
LOGP(DMGCP, LOGL_NOTICE,
"The SSRC changed on 0x%x: %u -> %u "
"from %s:%d in %d\n",
ENDPOINT_NUMBER(endp),
state->in_stream.ssrc, rtp_hdr->ssrc,
inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
endp->conn_mode);
if (tsdelta == 0) {
tsdelta = rtp_end->rate * rtp_end->frames_per_packet *
rtp_end->frame_duration_num /
@ -265,13 +274,6 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta
state->timestamp_offset =
(state->out_stream.last_timestamp + tsdelta) - timestamp;
state->patch = rtp_end->force_constant_ssrc;
LOGP(DMGCP, LOGL_NOTICE,
"The SSRC changed on 0x%x SSRC: %u offset: %d tsdelta: %d "
"from %s:%d in %d\n",
ENDPOINT_NUMBER(endp), state->in_stream.ssrc,
state->seq_offset, tsdelta,
inet_ntoa(addr->sin_addr), ntohs(addr->sin_port),
endp->conn_mode);
state->in_stream.last_tsdelta = 0;
} else {