diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-11-25 15:23:35 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-25 18:30:50 +0100 |
commit | 72c309021a386a0ecc91784cc262892b6d2561e8 (patch) | |
tree | 08673913a4e6ae3c007f16c380aed08530822330 /openbsc/include/openbsc | |
parent | d62419b574f7002b1c857d9e2df72a95daca36f1 (diff) |
mgcp/rtp: Fix timestamp offset when patching RTP packets
The current implementation increments the seqno but does not increment
the RTP timestamp, leading to two identical timestamps following one
after the other.
This patch fixes this by adding the computed tsdelta when the offset
is calulated. In the unlikely case, that a tsdelta hasn't been
computed yet when the SSRC changes, a tsdelta is computed based on
the RTP rate and a RTP packet duration of 20ms (one speech frame per
channel and packet). If the RTP rate is not known, a rate of 8000 is
assumed.
Note that this approach presumes, that the per RTP packet duration
(in samples) is the same for the last two packets of the stream being
replaced (the first one).
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r-- | openbsc/include/openbsc/mgcp_internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 8b6a56be8..0b52c1c06 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -77,6 +77,10 @@ struct mgcp_rtp_end { /* per endpoint data */ int payload_type; + uint32_t rate; + uint32_t frame_duration_num; + uint32_t frame_duration_den; + int frames_per_packet; char *fmtp_extra; /* |