From cb8686cd520776affe728bc4871eee2d2ca7894b Mon Sep 17 00:00:00 2001 From: Daniel Flores Date: Tue, 22 Jul 2025 23:58:54 -0400 Subject: [PATCH] pass frame mappings by reference --- src/torchcodec/_core/custom_ops.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/torchcodec/_core/custom_ops.cpp b/src/torchcodec/_core/custom_ops.cpp index 674f67252..daec2010e 100644 --- a/src/torchcodec/_core/custom_ops.cpp +++ b/src/torchcodec/_core/custom_ops.cpp @@ -108,9 +108,9 @@ OpsFrameOutput makeOpsFrameOutput(FrameOutput& frame) { SingleStreamDecoder::FrameMappings makeFrameMappings( std::tuple custom_frame_mappings) { return SingleStreamDecoder::FrameMappings{ - std::get<0>(custom_frame_mappings), - std::get<1>(custom_frame_mappings), - std::get<2>(custom_frame_mappings)}; + std::move(std::get<0>(custom_frame_mappings)), + std::move(std::get<1>(custom_frame_mappings)), + std::move(std::get<2>(custom_frame_mappings))}; } // All elements of this tuple are tensors of the same leading dimension. The @@ -281,7 +281,7 @@ void add_video_stream( std::optional dimension_order = std::nullopt, std::optional stream_index = std::nullopt, std::optional device = std::nullopt, - std::optional> + const std::optional>& custom_frame_mappings = std::nullopt) { _add_video_stream( decoder,