libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
145 stars 48 forks source link

Desktop: Synchronise video to audio #85

Open Frosty-J opened 7 months ago

Frosty-J commented 7 months ago

On Windows, when the game is dragged for a few seconds, the audio pauses. That's just how libGDX is, nothing to do with gdx-video specifically. But the result of that is the System.currentTimeMillis() calculation falls out of sync.

I've tried to improve the situation here, but I'm unsure how robust it is. It will invariably get tested while I develop my game.

Note: This does not do anything to fix the fact gdx-video isn't very good at keeping up. E.g. if a 60fps video is played on a 50Hz monitor, video playback will still fall behind if the video is only updated once per frame. I think that's best tackled separately.