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.
2 parents 42409a9 + 982102b commit 9acc148Copy full SHA for 9acc148
src/torchcodec/_core/SingleStreamDecoder.cpp
@@ -1116,7 +1116,11 @@ bool SingleStreamDecoder::canWeAvoidSeeking() const {
1116
// within getFramesPlayedInRangeAudio(), when setCursorPtsInSeconds() was
1117
// called. For more context, see [Audio Decoding Design]
1118
return !cursorWasJustSet_;
1119
+ } else if (!cursorWasJustSet_) {
1120
+ // For videos, when decoding consecutive frames, we don't need to seek.
1121
+ return true;
1122
}
1123
+
1124
if (cursor_ < lastDecodedAvFramePts_) {
1125
// We can never skip a seek if we are seeking backwards.
1126
return false;
0 commit comments