* Convert AVPacket::pts to a stream-relative time stamp (still in * AVStream::time_base units). Returns a negative value on error. */
| 170 | * AVStream::time_base units). Returns a negative value on error. |
| 171 | */ |
| 172 | [[gnu::pure]] |
| 173 | static int64_t |
| 174 | StreamRelativePts(const AVPacket &packet, const AVStream &stream) noexcept |
| 175 | { |
| 176 | auto pts = packet.pts; |
| 177 | if (pts < 0 || pts == int64_t(AV_NOPTS_VALUE)) |
| 178 | return -1; |
| 179 | |
| 180 | auto start = start_time_fallback(stream); |
| 181 | return pts - start; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Convert a non-negative stream-relative time stamp in |
no test coverage detected