Skip to content

VIDEO: Fix seeking to a keyframe in BINK videos#7180

Merged
lephilousophe merged 1 commit intoscummvm:masterfrom
antoniou79:fixSeekToKeyframeBinkUnderflow
Feb 1, 2026
Merged

VIDEO: Fix seeking to a keyframe in BINK videos#7180
lephilousophe merged 1 commit intoscummvm:masterfrom
antoniou79:fixSeekToKeyframeBinkUnderflow

Conversation

@antoniou79
Copy link
Copy Markdown
Contributor

When seeking to a keyframe, that is not the first frame of the video, audio should not break or desync

The special code in BinkDecoder::BinkAudioTrack::seek() for fixing audio underrun should apply in the case of key frames as well

A test case for this issue can be constructed in MYST3, if the video at the start (10002), when Catherine is sitting on the bench with the baby and talks to the stranger, is set to start at frame 1 instead of 2.

If the fix is correct, it allows for some (future) fixes in the video playing code for Myst 3, that are currently breaking due to this audio issue.

When seeking to a keyframe, that is not the first frame of the video, audio should not break or desync

The special code in BinkDecoder::BinkAudioTrack::seek() for fixing audio underrun should apply in the case of key frames as well

A test case for this issue can be constructed in MYST3, if the video at the start (10002), when Catherine is sitting on the bench with the baby and talks to the stranger, is set to start at frame 1 instead of 2.
@lephilousophe
Copy link
Copy Markdown
Member

Without knowing anything about the codec, this seems completely sensible.
The first part of the function seeks to keyFrame and then, if the target frame is not a keyframe, we decode the progressive frames up to the target and skip the proper amount of audio samples.

@aquadran
Copy link
Copy Markdown
Member

aquadran commented Feb 1, 2026

Without knowing anything about the codec, this seems completely sensible. The first part of the function seeks to keyFrame and then, if the target frame is not a keyframe, we decode the progressive frames up to the target and skip the proper amount of audio samples.

unfortunately I can't add anything more, but also sensible for me.

@lephilousophe lephilousophe merged commit c88d19d into scummvm:master Feb 1, 2026
1 check passed
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.

3 participants