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.
This commit is contained in:
1 parent
72a1e9dc71
commit
bd88d7328d
1 file changed
+6
-2
@@ -46,8 +46,12 @@ class ProgressFfmpeg(threading.Thread):
|
||||
if lines:
|
||||
for line in lines:
|
||||
if "out_time_ms" in line:
|
||||
out_time_ms = line.split("=")[1]
|
||||
return int(out_time_ms) / 1000000.0
|
||||
out_time_ms_str = line.split("=")[1].strip()
|
||||
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
|
||||
|
||||
def stop(self):
|
||||
|
||||
Reference in new issue
Block a user