Skip to content

Commit 0ff2701

Browse files
committed
lint
1 parent 997158f commit 0ff2701

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ void VideoEncoder::initializeEncoder(
627627

628628
// Try to find a hardware-accelerated encoder if not using CPU
629629
if (videoStreamOptions.device.type() != torch::kCPU) {
630-
avCodec = deviceInterface_->findEncoder(avFormatContext_->oformat->video_codec).value_or(avCodec);
630+
avCodec =
631+
deviceInterface_->findEncoder(avFormatContext_->oformat->video_codec)
632+
.value_or(avCodec);
631633
}
632634

633635
AVCodecContext* avCodecContext = avcodec_alloc_context3(avCodec);

test/test_ops.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,6 @@ def test_video_encoder_against_ffmpeg_cli(self, tmp_path, format, device):
13021302
pytest.skip("Codec for webm is not available in this FFmpeg installation.")
13031303

13041304
# Pass flag to FFmpeg CLI to NVENC encoder when device is CUDA and format has a compatible NVENC codec
1305-
codec_str = ""
13061305
if device == "cuda":
13071306
if format not in ("mp4", "mov", "mkv"):
13081307
pytest.skip(
@@ -1411,10 +1410,7 @@ def get_encoded_data(self):
14111410
else:
14121411
assert_close = partial(torch.testing.assert_close, atol=2)
14131412

1414-
assert_close(
1415-
decoded_samples.data,
1416-
source_frames
1417-
)
1413+
assert_close(decoded_samples.data, source_frames)
14181414

14191415
@pytest.mark.parametrize(
14201416
"device", ("cpu", pytest.param("cuda", marks=pytest.mark.needs_cuda))
@@ -1440,10 +1436,7 @@ def test_to_file_like_real_file(self, tmp_path, device):
14401436
else:
14411437
assert_close = partial(torch.testing.assert_close, atol=2)
14421438

1443-
assert_close(
1444-
decoded_samples.data,
1445-
source_frames
1446-
)
1439+
assert_close(decoded_samples.data, source_frames)
14471440

14481441
def test_to_file_like_bad_methods(self):
14491442
source_frames = self.decode(TEST_SRC_2_720P.path).data

0 commit comments

Comments
 (0)