Skip to content

Commit

Permalink
Merge pull request #34 from alecchangod/main
Browse files Browse the repository at this point in the history
ffcuesplitter: fix ValueError when processing the progress bar
  • Loading branch information
jeanslack authored Jan 7, 2024
2 parents eb46337 + 01857c6 commit c593b7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ffcuesplitter/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ def run_ffmpeg_command_with_progress(self, cmd, seconds):

for output in proc.stdout:
if "out_time_ms" in output.strip():
s_processed = int(output.split('=')[1]) / 1_000_000
percent = s_processed / seconds * 100
progbar.update(round(percent) - progbar.n)
out_time_ms_val = output.split('=')[1].strip()
if out_time_ms_val.isdigit():
s_processed = int(out_time_ms_val) / 1_000_000
percent = s_processed / seconds * 100
progbar.update(round(percent) - progbar.n)

if proc.wait(): # error
logging.error("Popen proc.wait() Exit status %s",
Expand Down

0 comments on commit c593b7e

Please sign in to comment.