| 51 | #include "url.h" |
| 52 | |
| 53 | static 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 | |
| 68 | int64_t ff_wrap_timestamp(const AVStream *st, int64_t timestamp) |
| 69 | { |
no test coverage detected