Auto-restart problem


01-08-2010 14:05:36


I'm trying to integrate libtheoraplayer in my project, and I encountered a problem.

I have a video playing in my scene, with autoRestart set to true. It works great, but from time to time, the video stalls at the end, when it should restart, and stays still for the entire duration of the clip. Then restarts and continues playing correctly.

I tried to debug it, and I found the problem is TheoraFrameQueue::requestEmptyFrame() never returns a frame, because all the frames in queue are marked as in-use. The queue contains one frame from the end of the clip, and a bunch of frames from the beginning of the clip. The result is, TheoraVideoClip::getNextFrame() returns NULL, because the first frame in queue has a higher time than current time, therefore popFrame() is never called, therefore the queue runs out of free slots very soon.

I'm not sure how this can happen (I don't understand the code well enough, yet :)). Perhaps when the clip wraps over, the very last frame isn't properly removed from the queue, which effectively freezes the queue? I'll be grateful for any ideas.

Also, I noticed some memory leaks in TheoraVideoClip and described them in the issue tracker.

In closing, I would like to express my gratitude to Kreso for this project. Xiph's code isn't very user friendly, and this library is a blessing. Thanks a lot!


01-08-2010 14:30:16

yeah, I noticed that too, but couldn't put my finger on it. thanks, I'll look into it.
can you please submit this to the issue tracker, i use that as a todo list for the project :)

and thanks for the thanks :) yeah,'s theora api is horrible to use. like Perl on steroids..