File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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];
You can’t perform that action at this time.
0 commit comments