1
0

bytebeat_compiler.py: fix None value bug

This commit is contained in:
Intel A80486DX2-66 2024-01-11 23:03:45 +03:00
parent df239dc9bb
commit 01efd27e07
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -162,6 +162,8 @@ if __name__ == "__main__":
final_sample_rate_code = f"w /= {sample_rate_ratio}L;" final_sample_rate_code = f"w /= {sample_rate_ratio}L;"
args.sample_rate = args.final_sample_rate args.sample_rate = args.final_sample_rate
final_sample_rate = \
value if (value := args.final_sample_rate) else original_sample_rate
samples = 0 samples = 0
while True: while True:
no_seconds = args.seconds is None or args.seconds == 0 no_seconds = args.seconds is None or args.seconds == 0
@ -176,9 +178,9 @@ if __name__ == "__main__":
if no_seconds and samples_exist: if no_seconds and samples_exist:
samples = args.samples samples = args.samples
elif seconds_exist and samples_exist: elif seconds_exist and samples_exist:
samples = args.seconds * args.final_sample_rate + args.samples samples = args.seconds * final_sample_rate + args.samples
elif seconds_exist and no_samples: elif seconds_exist and no_samples:
samples = args.seconds * args.final_sample_rate samples = args.seconds * final_sample_rate
elif no_seconds and no_samples: elif no_seconds and no_samples:
args.seconds = 30 # default args.seconds = 30 # default
continue continue