fix: playback of malformed MP4 files with invalid framerates

- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.

Some malformed MP4 files previously wouldn't play at all because they
reported a 0/1 framerate.
Other files suffered from severe audio stuttering caused by repeated
long GAP events emitted from malformed edit lists.
This patch treats invalid framerates as unknown (allowing the existing
fallback to be used) and suppresses suspicious long audio GAP events
before they reach the audio sink.
As a result, both kinds of videos now play correctly.
This commit is contained in:
krakotay 2026-08-29 08:31:43 +08:00 • committed by GitHub
parent c9cba75c84
commit e040f7fbc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 92 additions and 8 deletions

2
Cargo.lock generated
View file

@ -2808,7 +2808,7 @@ dependencies = [
[[package]]
name = "iced_video_player"
version = "0.6.0"
source = "git+https://github.com/wash2/iced_video_player.git?branch=iced-rebase#cb3635192f3dec37619855c904a168ca37a3dac3"
source = "git+https://github.com/wash2/iced_video_player.git?branch=iced-rebase#2e82b6b08d1751924b7b21b8c56683cdbc57bc33"
dependencies = [
"glib",
"gstreamer",