xbmc-imx6/xbmc — pull request #8 by koying (2014-02-21 10:48:27+00:00)
Title: [imx] Use sorted queue for pts

The current pts implementation have issues with some h264 where reorder is in function.
The h264 encoding is so that an input frame may need frames before or after it to be rendered. As such, an output frame in ::Decode might be completely unrelated to the current input frame and putting the current input pts is problematic. Furthermore, the input pts are unordered.

As we enable reordering ("m_decOpenParam.nReorderEnable"), we are certain the output frames are in order, but the VPU doesn't give us any mean to know which output frame we are dealing with (big oversight, imo).

This PR creates a pts ordered queue which runs in parallel with the output frame stream.
As 1 input frame = 1 output frame and the output frames are ordered, this solves the problem.

I haven't have much time to test, yet, but seems ok. Please give it a try on your side.

Note: For unknown reason, doing the pts push at "VPU_DecGetConsumedFrameInfo" time produces sync issues. Not sure why....