Confirm out_time_ms is a number

In get_latest_ms_progress(), the value of out_time_ms can equal 'N/A\n', this code confirms this will not be the case in the future. Since this is only a progress indicator, it should not crash the program.
pull/1771/head
BrandonHalig 1 year ago committed by GitHub
parent 72a1e9dc71
commit bd88d7328d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,8 +46,12 @@ class ProgressFfmpeg(threading.Thread):
if lines: if lines:
for line in lines: for line in lines:
if "out_time_ms" in line: if "out_time_ms" in line:
out_time_ms = line.split("=")[1] out_time_ms_str = line.split("=")[1].strip()
return int(out_time_ms) / 1000000.0 if out_time_ms_str.isnumeric():
return float(out_time_ms_str) / 1000000.0
else:
# Handle the case when "N/A" is encountered
return None
return None return None
def stop(self): def stop(self):

Loading…
Cancel
Save