Skip to content

Refactor progress parsing to handle exceptions gracefully#416

Open
jeongmallro wants to merge 3 commits into
bramp:mainfrom
jeongmallro:refactor/handle-progress-exception-gracefully
Open

Refactor progress parsing to handle exceptions gracefully#416
jeongmallro wants to merge 3 commits into
bramp:mainfrom
jeongmallro:refactor/handle-progress-exception-gracefully

Conversation

@jeongmallro

@jeongmallro jeongmallro commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Hello. This PR resolves issue #333.
If parsing fails, it returns -1 for primitive fields and null for object fields (such as Fraction and Status).

@Bappy1988

Copy link
Copy Markdown

Having trouble upgrading to FFMPEG 8.0.1 because somewhere between the old version I'm using and 8.0.1 the progress output has changed.

looks to me like the initial progress message generated is causing the progress listener to fall flat, as per the issue mentioned in 333.

However, when I run a transcode in the cli that fails via my Java app, the initial progress message output by FFMPEG looks like it would be handled safely by the existing ="N/A" checking that exists on some fields.

I wonder whether in fact a NULL is being fed into the parseLine method somewhere instead. at the moment the null checks are just manually throwing null pointer exceptions (completely useless check IMO) and I wonder if replacing the null checks with

if (valueToCheck == null ) {
   return false
}  

would be a better approach? that would ensure that even if FFMPEG throws a null out to the progress listener it's not going to kill the whole process

@Bappy1988

Copy link
Copy Markdown

That being said, I consider this PR to be an improvement over the existing parseLine method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants