Skip to content

Commit 42409a9

Browse files
committed
comment
1 parent d98c78a commit 42409a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ FrameOutput SingleStreamDecoder::getFrameAtIndexInternal(
626626
}
627627
validateFrameIndex(streamMetadata, frameIndex);
628628

629-
// Only set cursor if we're not decoding sequentially
629+
// 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.
630632
if (frameIndex != lastDecodedFrameIndex_ + 1) {
631633
int64_t pts = getPts(frameIndex);
632634
setCursorPtsInSeconds(ptsToSeconds(pts, streamInfo.timeBase));

0 commit comments

Comments
 (0)