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 7d26623 commit 3a8839dCopy full SHA for 3a8839d
src/torchcodec/decoders/_core/VideoDecoder.cpp
@@ -1117,13 +1117,12 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesDisplayedByTimestamps(
1117
1118
auto it = std::lower_bound(
1119
stream.allFrames.begin(),
1120
- stream.allFrames.end(),
+ stream.allFrames.end() - 1,
1121
framePts,
1122
[&stream](const FrameInfo& info, double start) {
1123
return ptsToSeconds(info.nextPts, stream.timeBase) <= start;
1124
});
1125
int64_t frameIndex = it - stream.allFrames.begin();
1126
- frameIndex = std::min(frameIndex, (int64_t)stream.allFrames.size() - 1);
1127
frameIndices[i] = frameIndex;
1128
}
1129
0 commit comments