use bytes() over empty byte literals

This commit is contained in:
henryruhs
2026-05-14 22:44:56 +02:00
parent 1562fe2fee
commit 37420eac7c
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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))
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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))