We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d98c78a commit 42409a9Copy full SHA for 42409a9
src/torchcodec/_core/SingleStreamDecoder.cpp
@@ -626,7 +626,9 @@ FrameOutput SingleStreamDecoder::getFrameAtIndexInternal(
626
}
627
validateFrameIndex(streamMetadata, frameIndex);
628
629
- // Only set cursor if we're not decoding sequentially
+ // Only set cursor if we're not decoding sequentially: when decoding
630
+ // sequentially, we don't need to seek anywhere, so by *not* setting the
631
+ // cursor we allow canWeAvoidSeeking() to return true early.
632
if (frameIndex != lastDecodedFrameIndex_ + 1) {
633
int64_t pts = getPts(frameIndex);
634
setCursorPtsInSeconds(ptsToSeconds(pts, streamInfo.timeBase));
0 commit comments