To decode the audio frames correctly:
Check the pts value (presentation timestamp) and either skip audio frames or hold onto them until the timestamp is within ~1 game frame, then feed them into the buffer.
To prevent frame dropping from affecting game performance:
Mark the time when get_videoframe is called, while dropping frames check the elapsed time and stop decoding frames if too much time has elapesd (hard coded at 10ms currently)
This isn't really supported by the VideoStreamGdnative interface! The workaround is to lie about the video position during update(). If we are dropping frames then we will tell godot that the video time is whatever it expects and it will stop calling get_videoframe().
Also lots of cleanup of stray printfs, debugging information etc.
ALSO: Fix for osxcross build and include libwinpthread-1.dll for windows
To decode the audio frames correctly: Check the
pts
value (presentation timestamp) and either skip audio frames or hold onto them until the timestamp is within ~1 game frame, then feed them into the buffer.To prevent frame dropping from affecting game performance: Mark the time when get_videoframe is called, while dropping frames check the elapsed time and stop decoding frames if too much time has elapesd (hard coded at 10ms currently) This isn't really supported by the VideoStreamGdnative interface! The workaround is to lie about the video position during
update()
. If we are dropping frames then we will tell godot that the video time is whatever it expects and it will stop callingget_videoframe()
.Also lots of cleanup of stray printfs, debugging information etc.
ALSO: Fix for osxcross build and include libwinpthread-1.dll for windows