diff options
author | Martin Storsjö <martin@martin.st> | 2010-03-10 22:21:39 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-03-10 22:21:39 +0000 |
commit | 594a9aebbebeb64f0476d1089d96e8670cd08bf3 (patch) | |
tree | c1d03c79f8ba0ccaaa6cca1d59d6aa981eca74f8 /libavformat/rtpenc.c | |
parent | 18c31f6ff8eef83cd19ea9e431335a854156dd18 (diff) | |
download | ffmpeg-594a9aebbebeb64f0476d1089d96e8670cd08bf3.tar.gz |
Make the ntp_time function available to other parts of libavformat, as ff_ntp_time
Originally committed as revision 22438 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r-- | libavformat/rtpenc.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 9a3eee96d3..633ce2995c 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -21,6 +21,7 @@ #include "avformat.h" #include "mpegts.h" +#include "internal.h" #include <unistd.h> @@ -29,13 +30,6 @@ //#define DEBUG #define RTCP_SR_SIZE 28 -#define NTP_OFFSET 2208988800ULL -#define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL) - -static uint64_t ntp_time(void) -{ - return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US; -} static int is_supported(enum CodecID id) { @@ -91,7 +85,7 @@ static int rtp_write_header(AVFormatContext *s1) s->cur_timestamp = 0; s->ssrc = 0; /* FIXME: was random(), what should this be? */ s->first_packet = 1; - s->first_rtcp_ntp_time = ntp_time(); + s->first_rtcp_ntp_time = ff_ntp_time(); max_packet_size = url_fget_max_packet_size(s1->pb); if (max_packet_size <= 12) @@ -346,8 +340,8 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) / RTCP_TX_RATIO_DEN; if (s->first_packet || ((rtcp_bytes >= RTCP_SR_SIZE) && - (ntp_time() - s->last_rtcp_ntp_time > 5000000))) { - rtcp_send_sr(s1, ntp_time()); + (ff_ntp_time() - s->last_rtcp_ntp_time > 5000000))) { + rtcp_send_sr(s1, ff_ntp_time()); s->last_octet_count = s->octet_count; s->first_packet = 0; } |