Skip to content

Conversation

@DanielGibson
Copy link
Member

based on a patch from @dezo2 for high-fps support, who took the general idea from D3BFG

this works around the problem that for most framerates, with integer frametimes, gameHz * frametime doesn't add up to 1000ms (e.g. 120Hz * 8ms = 960ms), by making some frames a millisecond longer

This problem even exists at 60fps, where the integer frametime is 16 (while it should be 16.666), this causes audio and video in cut scenes (or longer animated talking NPC) and videos to get out of sync. It only worked properly when running without vsync so the game ran at 62.5fps - but now that dhewm3 enforces proper 60fps, the problem always occurs. This commit should fix that.

fix #703

based on a patch from @dezo2 for high-fps support, who took the general
idea from D3BFG

this works around the problem that for most framerates, with integer
frametimes, gameHz * frametime doesn't add up to 1000ms
(e.g. 120Hz * 8ms = 960ms), by making some frames a millisecond longer

This problem even exists at 60fps, where the integer frametime is 16
(while it should be 16.666), this causes audio and video in cut scenes
(or longer animated talking NPC) and videos to get out of sync.
It only worked properly when running without vsync so the game ran at
62.5fps - but now that dhewm3 enforces proper 60fps, the problem always
occurs. This commit should fix that.

fix dhewm#703
@DanielGibson
Copy link
Member Author

testbuild for windows: dhewm3-win32-ff5f9f2.zip

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Pre-rendered video and audio are out of sync

1 participant