diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-12-04 10:30:11 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-12-10 11:17:44 +0100 |
commit | f6ec0e9fc4261d2173286e9b23fd19060040d1d1 (patch) | |
tree | f0dbbb3581da797161cbc4a713781333a15439e0 /openbsc/src/libmgcp/mgcp_network.c | |
parent | 58340e5b5bfa37b09a61d544904330c1932ccfec (diff) |
mgcp/rtp: Refactored packet_duration computation
Since the packet duration is given in ms with the 'ptime' RTP media
attribute and also with the 'p' MGCP local connection option, the
computation is changed to use this value (if present). The
computation assumes, that there are N complete frames in a packet and
takes into account, that the ptime value possibly had been rounded
towards the next ms value (which is never the case with a frame length
of exact 20ms).
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libmgcp/mgcp_network.c')
-rw-r--r-- | openbsc/src/libmgcp/mgcp_network.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index 6463ae0bb..bf205d1c7 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -237,10 +237,7 @@ void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *sta state->initialized = 1; state->jitter = 0; state->transit = arrival_time - timestamp; - state->packet_duration = - rtp_end->rate * rtp_end->frames_per_packet * - rtp_end->frame_duration_num / - rtp_end->frame_duration_den; + state->packet_duration = mgcp_rtp_packet_duration(endp, rtp_end); state->out_stream = state->in_stream; state->out_stream.last_timestamp = timestamp; state->out_stream.ssrc = ssrc - 1; /* force output SSRC change */ |