From e52ca9aad1cc0e1d8f3233852bb83f3e6367fa6a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 2 Jul 2014 21:56:26 +0200 Subject: mgcp: Warn when the buffer is being reset due a wrong seq number When the sample buffer is being dropped write a warning so we can see how often this event occurs. --- openbsc/src/libmgcp/mgcp_transcode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'openbsc/src/libmgcp') diff --git a/openbsc/src/libmgcp/mgcp_transcode.c b/openbsc/src/libmgcp/mgcp_transcode.c index b76c5d9ac..a5f71faf6 100644 --- a/openbsc/src/libmgcp/mgcp_transcode.c +++ b/openbsc/src/libmgcp/mgcp_transcode.c @@ -486,15 +486,18 @@ int mgcp_transcoding_process_rtp(struct mgcp_endpoint *endp, int32_t delta = ts_no - state->next_time; /* TODO: check sequence? reordering? packet loss? */ - if (delta > state->sample_cnt) + if (delta > state->sample_cnt) { /* There is a time gap between the last packet * and the current one. Just discard the * partial data that is left in the buffer. * TODO: This can be improved by adding silence * instead if the delta is small enough. */ + LOGP(DMGCP, LOGL_NOTICE, + "0x%x dropping sample buffer due delta=%d sample_cnt=%d\n", + ENDPOINT_NUMBER(endp), delta, state->sample_cnt); state->sample_cnt = 0; - else if (delta < 0) { + } else if (delta < 0) { LOGP(DMGCP, LOGL_NOTICE, "RTP time jumps backwards, delta = %d, " "discarding buffered samples\n", -- cgit v1.2.3