Skip to content

Commit a3d8f14

Browse files
committed
std::move
1 parent c69064f commit a3d8f14

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/torchcodec/_core/custom_ops.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <cstdint>
99
#include <sstream>
1010
#include <string>
11+
#include <utility>
1112
#include "AVIOFileLikeContext.h"
1213
#include "AVIOTensorContext.h"
1314
#include "Encoder.h"
@@ -620,7 +621,7 @@ void encode_video_to_file(
620621
std::optional<std::vector<std::string>> extra_options = std::nullopt) {
621622
VideoStreamOptions videoStreamOptions;
622623
videoStreamOptions.codec = codec;
623-
videoStreamOptions.pixelFormat = pixel_format;
624+
videoStreamOptions.pixelFormat = std::move(pixel_format);
624625
videoStreamOptions.crf = crf;
625626
videoStreamOptions.preset = preset;
626627

@@ -649,7 +650,7 @@ at::Tensor encode_video_to_tensor(
649650
auto avioContextHolder = std::make_unique<AVIOToTensorContext>();
650651
VideoStreamOptions videoStreamOptions;
651652
videoStreamOptions.codec = codec;
652-
videoStreamOptions.pixelFormat = pixel_format;
653+
videoStreamOptions.pixelFormat = std::move(pixel_format);
653654
videoStreamOptions.crf = crf;
654655
videoStreamOptions.preset = preset;
655656

@@ -685,7 +686,7 @@ void _encode_video_to_file_like(
685686

686687
VideoStreamOptions videoStreamOptions;
687688
videoStreamOptions.codec = codec;
688-
videoStreamOptions.pixelFormat = pixel_format;
689+
videoStreamOptions.pixelFormat = std::move(pixel_format);
689690
videoStreamOptions.crf = crf;
690691
videoStreamOptions.preset = preset;
691692

0 commit comments

Comments
 (0)