xbmc/xbmc — pull request #2080 by popcornmix (2013-01-15 19:45:41+00:00)
Title: [rbp] Fix for audio out of sync part 2

Fix for this problem:
http://forum.stmlabs.com/showthread.php?tid=5629&pid=48268#pid48268

Basically we assume that packed b frame avi files have no pts timestamps and we should use dts. To distinguish these types of files from other files with occasional missing timestamps (e.g. B frames in ts file) we flag whether we've ever seen a valid pts.

The linked file has about six valid pts values spread through the file. Not sure why. They always equal the dts.

This patch assumes the B frames case will have at least 4 valid timestamps in last 16, and if less than that, then it is the sporadic pts case.