File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1100,6 +1100,8 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesDisplayedByTimestamps(
11001100 // eps` are probably the same frame, with the same index. The easiest way to
11011101 // avoid decoding that unique frame twice is to convert the input timestamps
11021102 // to indices, and leverage the de-duplication logic of getFramesAtIndices.
1103+ // This means this function requires a scan.
1104+ // TODO: longer term, we should implement this without requiring a scan
11031105
11041106 const auto & streamMetadata = containerMetadata_.streams [streamIndex];
11051107 const auto & stream = streams_[streamIndex];
@@ -1119,8 +1121,8 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesDisplayedByTimestamps(
11191121 stream.allFrames .begin (),
11201122 stream.allFrames .end () - 1 ,
11211123 framePts,
1122- [&stream](const FrameInfo& info, double start ) {
1123- return ptsToSeconds (info.nextPts , stream.timeBase ) <= start ;
1124+ [&stream](const FrameInfo& info, double framePts ) {
1125+ return ptsToSeconds (info.nextPts , stream.timeBase ) <= framePts ;
11241126 });
11251127 int64_t frameIndex = it - stream.allFrames .begin ();
11261128 frameIndices[i] = frameIndex;
You can’t perform that action at this time.
0 commit comments