Skip to content

Commit da59be4

Browse files
committed
merge fixes
1 parent 978a996 commit da59be4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

test/samplers/test_samplers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)