MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / wrap_timestamp

Function wrap_timestamp

libavformat/demux.c:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51#include "url.h"
52
53static int64_t wrap_timestamp(const AVStream *st, int64_t timestamp)
54{
55 const FFStream *const sti = cffstream(st);
56 if (sti->pts_wrap_behavior != AV_PTS_WRAP_IGNORE && st->pts_wrap_bits < 64 &&
57 sti->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != AV_NOPTS_VALUE) {
58 if (sti->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET &&
59 timestamp < sti->pts_wrap_reference)
60 return timestamp + (1ULL << st->pts_wrap_bits);
61 else if (sti->pts_wrap_behavior == AV_PTS_WRAP_SUB_OFFSET &&
62 timestamp >= sti->pts_wrap_reference)
63 return timestamp - (1ULL << st->pts_wrap_bits);
64 }
65 return timestamp;
66}
67
68int64_t ff_wrap_timestamp(const AVStream *st, int64_t timestamp)
69{

Callers 2

ff_wrap_timestampFunction · 0.85
update_timestampsFunction · 0.85

Calls 1

cffstreamFunction · 0.85

Tested by

no test coverage detected