From 4e4ac2034048271d280235860240c795dabeed99 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 4 Oct 2019 11:58:29 -0300 Subject: avformat/utils: make ff_ntp_time() accept a timestamp as input argument Will be needed by the next patch. Signed-off-by: James Almer --- libavformat/rtpenc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libavformat/rtpenc.c') 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; -- cgit v1.2.1