MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / StreamRelativePts

Function StreamRelativePts

src/decoder/plugins/FfmpegDecoderPlugin.cxx:172–182  ·  view source on GitHub ↗

* Convert AVPacket::pts to a stream-relative time stamp (still in * AVStream::time_base units). Returns a negative value on error. */

Source from the content-addressed store, hash-verified

170 * AVStream::time_base units). Returns a negative value on error.
171 */
172[[gnu::pure]]
173static int64_t
174StreamRelativePts(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

Callers 1

ffmpeg_send_packetFunction · 0.85

Calls 1

start_time_fallbackFunction · 0.85

Tested by

no test coverage detected