Skip to content

Commit 12c0e29

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into pts_sort_and_dedup
2 parents be80996 + c8de21c commit 12c0e29

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,11 +1034,6 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesAtIndices(
10341034
validateUserProvidedStreamIndex(streamIndex);
10351035
validateScannedAllStreams("getFramesAtIndices");
10361036

1037-
const auto& streamMetadata = containerMetadata_.streams[streamIndex];
1038-
const auto& stream = streams_[streamIndex];
1039-
const auto& options = stream.options;
1040-
BatchDecodedOutput output(frameIndices.size(), options, streamMetadata);
1041-
10421037
auto indicesAreSorted =
10431038
std::is_sorted(frameIndices.begin(), frameIndices.end());
10441039

@@ -1058,6 +1053,11 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesAtIndices(
10581053
});
10591054
}
10601055

1056+
const auto& streamMetadata = containerMetadata_.streams[streamIndex];
1057+
const auto& stream = streams_[streamIndex];
1058+
const auto& options = stream.options;
1059+
BatchDecodedOutput output(frameIndices.size(), options, streamMetadata);
1060+
10611061
auto previousIndexInVideo = -1;
10621062
for (auto f = 0; f < frameIndices.size(); ++f) {
10631063
auto indexInOutput = indicesAreSorted ? f : argsort[f];

0 commit comments

Comments
 (0)