I am using Ffmpeg to decode and play video files. I have currently got the video playing and the audio playing at as fast as the CPU can decode and display them. The problem is that I want to play the video and audio in sync using the system clock.
I've searched around for some help but can't find anything substantial other than dranger's tutorial 05 but I don't really understand what he is doing because my program isn't written in the same way as his.
I am using mjpeg files and so the pts seems to be retrieved every single time a frame is decoded, I have multiplied the pts by the time_base as dranger does to get the value in seconds but the resolution seems to be only seconds and so I get the value "6" 25 times and then "7" 25 times as the video runs at 25 frames per second.
Is there not a more accurate value? Or way to get a more accurate value and if so, how would I go about syncing to this value? I am using SDL to display the value so can I just use a SDL_Delay() of the value I get?
Thanks for your time,
Infinitifizz