summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-10-04 11:58:29 -0300
committerJames Almer <jamrial@gmail.com>2020-01-15 23:34:20 -0300
commit4e4ac2034048271d280235860240c795dabeed99 (patch)
treea7e8080cb15af0af3c3f408a7c4ab6d9f810b7ca /libavformat/rtpenc.c
parent56c8856966ecc7a016aa0edb5472a902a7fbd49a (diff)
downloadffmpeg-4e4ac2034048271d280235860240c795dabeed99.tar.gz
avformat/utils: make ff_ntp_time() accept a timestamp as input argument
Will be needed by the next patch. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r--libavformat/rtpenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 63047beccc..b4f2504123 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -124,7 +124,7 @@ static int rtp_write_header(AVFormatContext *s1)
if (!s->ssrc)
s->ssrc = av_get_random_seed();
s->first_packet = 1;
- s->first_rtcp_ntp_time = ff_ntp_time();
+ s->first_rtcp_ntp_time = ff_ntp_time(av_gettime());
if (s1->start_time_realtime != 0 && s1->start_time_realtime != AV_NOPTS_VALUE)
/* Round the NTP time to whole milliseconds. */
s->first_rtcp_ntp_time = (s1->start_time_realtime / 1000) * 1000 +
@@ -526,9 +526,9 @@ 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) &&
- (ff_ntp_time() - s->last_rtcp_ntp_time > 5000000))) &&
+ (ff_ntp_time(av_gettime()) - s->last_rtcp_ntp_time > 5000000))) &&
!(s->flags & FF_RTP_FLAG_SKIP_RTCP)) {
- rtcp_send_sr(s1, ff_ntp_time(), 0);
+ rtcp_send_sr(s1, ff_ntp_time(av_gettime()), 0);
s->last_octet_count = s->octet_count;
s->first_packet = 0;
}
@@ -642,7 +642,7 @@ static int rtp_write_trailer(AVFormatContext *s1)
/* If the caller closes and recreates ->pb, this might actually
* be NULL here even if it was successfully allocated at the start. */
if (s1->pb && (s->flags & FF_RTP_FLAG_SEND_BYE))
- rtcp_send_sr(s1, ff_ntp_time(), 1);
+ rtcp_send_sr(s1, ff_ntp_time(av_gettime()), 1);
av_freep(&s->buf);
return 0;