File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -1119,16 +1119,15 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesDisplayedByTimestamps(
11191119
11201120 auto it = std::lower_bound (
11211121 stream.allFrames .begin (),
1122- // See https://github.com/pytorch/torchcodec/pull/286 for why the `- 1`
1123- // is needed.
1124- stream.allFrames .end () - 1 ,
1122+ stream.allFrames .end (),
11251123 framePts,
11261124 [&stream](const FrameInfo& info, double framePts) {
11271125 return ptsToSeconds (info.nextPts , stream.timeBase ) <= framePts;
11281126 });
11291127 int64_t frameIndex = it - stream.allFrames .begin ();
11301128 frameIndices[i] = frameIndex;
11311129 }
1130+
11321131 return getFramesAtIndices (streamIndex, frameIndices);
11331132}
11341133
Original file line number Diff line number Diff line change @@ -383,7 +383,6 @@ def test_random_sampler_randomness(sampler):
383383 # Assert the clip starts aren't sorted, to make sure we haven't messed up
384384 # the implementation. (This may fail if we're unlucky, but we hard-coded a
385385 # seed, so it will always pass.)
386- # clip_starts = [clip.pts_seconds.item() for clip in clips_1]
387386 clip_starts = clips_1 .pts_seconds [:, 0 ].tolist ()
388387 assert sorted (clip_starts ) != clip_starts
389388
You can’t perform that action at this time.
0 commit comments