From 37420eac7ccc6ac23de8742bdb4337873988a585 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Thu, 14 May 2026 22:44:56 +0200 Subject: [PATCH] use bytes() over empty byte literals --- facefusion/codecs/aom.py | 4 ++-- facefusion/codecs/opus.py | 2 +- facefusion/codecs/vpx.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/facefusion/codecs/aom.py b/facefusion/codecs/aom.py index a005ebd5..adbcd74d 100644 --- a/facefusion/codecs/aom.py +++ b/facefusion/codecs/aom.py @@ -35,7 +35,7 @@ def create_aom_encoder(frame_resolution : Resolution, bitrate : BitRate, thread_ def encode_aom_buffer(aom_encoder : AomEncoder, input_buffer : bytes, frame_resolution : Resolution, frame_index : int) -> bytes: aom_library = aom_module.create_static_library() - output_buffer = b'' + output_buffer = bytes() if aom_library: temp_buffer = ctypes.create_string_buffer(256) @@ -49,7 +49,7 @@ def encode_aom_buffer(aom_encoder : AomEncoder, input_buffer : bytes, frame_reso def collect_aom_buffer(aom_encoder : AomEncoder) -> bytes: aom_library = aom_module.create_static_library() - output_buffer = b'' + output_buffer = bytes() packet_cursor = ctypes.c_void_p(0) packet = aom_library.aom_codec_get_cx_data(aom_encoder, ctypes.byref(packet_cursor)) diff --git a/facefusion/codecs/opus.py b/facefusion/codecs/opus.py index cbcd8dd5..b34bcb6b 100644 --- a/facefusion/codecs/opus.py +++ b/facefusion/codecs/opus.py @@ -16,7 +16,7 @@ def create_opus_encoder(sample_rate : int, channel_total : int) -> Optional[Opus def encode_opus_buffer(opus_encoder : OpusEncoder, input_buffer : bytes, frame_size : int) -> bytes: opus_library = opus_module.create_static_library() - output_buffer = b'' + output_buffer = bytes() if opus_library: temp_buffer = ctypes.create_string_buffer(2048) diff --git a/facefusion/codecs/vpx.py b/facefusion/codecs/vpx.py index bfcc9a29..ebcacc56 100644 --- a/facefusion/codecs/vpx.py +++ b/facefusion/codecs/vpx.py @@ -39,7 +39,7 @@ def create_vpx_encoder(frame_resolution : Resolution, bitrate : BitRate, thread_ def encode_vpx_buffer(vpx_encoder : VpxEncoder, input_buffer : bytes, frame_resolution : Resolution, frame_index : int) -> bytes: vpx_library = vpx_module.create_static_library() - output_buffer = b'' + output_buffer = bytes() if vpx_library: temp_buffer = ctypes.create_string_buffer(256) @@ -53,7 +53,7 @@ def encode_vpx_buffer(vpx_encoder : VpxEncoder, input_buffer : bytes, frame_reso def collect_vpx_buffer(vpx_encoder : VpxEncoder) -> bytes: vpx_library = vpx_module.create_static_library() - output_buffer = b'' + output_buffer = bytes() packet_cursor = ctypes.c_void_p(0) packet = vpx_library.vpx_codec_get_cx_data(vpx_encoder, ctypes.byref(packet_cursor))