MCPcopy Create free account
hub / github.com/FFMS/ffms2 / FindClosestVideoKeyFrame

Method FindClosestVideoKeyFrame

src/core/track.cpp:196–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196int FFMS_Track::FindClosestVideoKeyFrame(int Frame) const {
197 frame_vec &Frames = Data->Frames;
198 Frame = std::min(std::max(Frame, 0), static_cast<int>(size()) - 1);
199 size_t PosInDecodingOrder = Frames[Frame].PosInDecodingOrder;
200 for (; PosInDecodingOrder > 0 && !(Frames[Frames[PosInDecodingOrder].OriginalPos].KeyFrame && Frames[Frames[PosInDecodingOrder].OriginalPos].PTS <= Frames[Frame].PTS); PosInDecodingOrder--);
201
202 return Frames[PosInDecodingOrder].OriginalPos;
203}
204
205int FFMS_Track::RealFrameNumber(int Frame) const {
206 return Data->RealFrameNumbers[Frame];

Callers 1

SeekToMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected