From 2e814d0329aded98c811d0502839618f08642685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 9 Jan 2013 18:55:52 +0200 Subject: rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/rtpenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavformat/rtpenc.c') diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index c82a73a84c..d33060770e 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -273,8 +273,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time) avio_w8(s1->pb, RTCP_SR); avio_wb16(s1->pb, 6); /* length in words - 1 */ avio_wb32(s1->pb, s->ssrc); - avio_wb32(s1->pb, ntp_time / 1000000); - avio_wb32(s1->pb, ((ntp_time % 1000000) << 32) / 1000000); + avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time)); avio_wb32(s1->pb, rtp_ts); avio_wb32(s1->pb, s->packet_count); avio_wb32(s1->pb, s->octet_count); -- cgit v1.2.3