diff options
author | Alok Priyadarshi <alokpr@gmail.com> | 2021-03-23 14:29:48 -0700 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-03-23 19:02:47 -0300 |
commit | adff25412a2929de67e44da1abaf67f9a267bdf4 (patch) | |
tree | b9872591f50e9d0257a4fe8e99940c0ade55701d /libavformat/utils.c | |
parent | 3220a908ca3c9e2d4108464f2127fdbb7479e69a (diff) |
avformat/rtpdec: attach producer reference time if available
This produces true wallclock time at rtp source instead of the
local wallclock time at rtp client.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 96a52e07d4..524765aeb4 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4706,6 +4706,15 @@ uint64_t ff_get_formatted_ntp_time(uint64_t ntp_time_us) return ntp_ts; } +uint64_t ff_parse_ntp_time(uint64_t ntp_ts) +{ + uint64_t sec = ntp_ts >> 32; + uint64_t frac_part = ntp_ts & 0xFFFFFFFFULL; + uint64_t usec = (frac_part * 1000000) / 0xFFFFFFFFULL; + + return (sec * 1000000) + usec; +} + int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags) { const char *p; |