[FFmpeg-devel] [PATCH] Extracting NTP timestamp from RTCP

Fred Rothganger frothga at sandia.gov
Thu Nov 7 22:47:40 CET 2013


On 11/07/2013 01:55 PM, Michael Niedermayer wrote:
> +                if (s->start_time_realtime == 0) {
> +                    s->start_time_realtime =
> +                          (((uint64_t) rtpctx->first_rtcp_ntp_time >> 32       ) - NTP_OFFSET) * 1000000
> +                        + ((           rtpctx->first_rtcp_ntp_time & 0xFFFFFFFF)               * 1000000 >> 32);
> why doesnt this use av_rescale ?
>
>

Mainly because I didn't think of it. I would still choose this code 
because the math is more efficient. Since this code executes very 
rarely, I gather your concern is more about readability. Attached is 
another patch that uses av_rescale.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtsp.patch
Type: text/x-patch
Size: 2569 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131107/c9852d86/attachment.bin>


More information about the ffmpeg-devel mailing list