That's working -- it switches seamlessly between videos without any flickering or glitches, so that's good
However, no matter what I try, I can't get the program to stop playing "catch up" with freshly opened videos!
Here's what I've observed:
- Tell program to open `video1.h264` and play it on loop
- Program begins streaming that file at the correct framerate.
- Several seconds later, send command telling program to open `video2.h264`.
- Program begins streaming `video2`, but for several seconds, plays the video far too fast. After a while, it seems to "catch up" and continue playing it at normal speed.
- For all subsequent new videos opened, the time it takes to "catch up" becomes longer and longer -- "catch up" time seems to be directly related to the running time of the program, so the longer the program runs for, the longer the catch up time.
(reading the messy draft version at https://www.khronos.org/registry/omxil/ ... edline.pdf) -- and they describe how the clock component is responsible for telling video_scheduler when to dispatch frames to the renderer component (I think?).
Is there a way to reset the clock when I'm playing a new video? Or at least tell it that a new video has started?
I've tried setting OMX_BUFFERFLAG_STARTTIME flag on the video_decode buffer whenever I start a new video. Otherwise, it's set to OMX_BUFFERFLAG_TIME_UNKNOWN. Removing the STARTTIME flag stops the video from playing at all.
I've also tried setting the clock's start time to the current wall time (feeding OMX_IndexConfigTimeCurrentWallTime to the clock state's 'nStartTime' property), makes no difference either (read only property?).
The messy source code of my program is here: