xbmc/xbmc — pull request #1458 by Memphiz (2012-09-21 17:22:26+00:00)
Title: Fix for embedded PGS Subtitles

This fixes the issue described in ticket #12074 which leads to PGS Subtitles only flashing up for one or 2 frames.

This PR backports a needed fix in ffmpeg for this and also adapts the CDVDOverlayCodecFFmpeg for fullfilling some assumptions made by ffmpeg.

There was a small refactor needed too in the DVDOverlayCodecs:

1. Instead of passing only a pts (which even might have beend overwritten by dts before) to the decoder - pass pts and dts of the packet into the decoder via reference for allowing the decoder to adapt it if needed
2. The dts to pts overwrite was therefore moved into the decoder

Basically behaviour shouldn't be changed by this for the overlay decoders. Only for the PGS case when using the CDVDOverlayCodecFFmpeg was altered (though it might be valid to do these changes in general - not only for PGS).

The analysis of the problem can be found here:

http://trac.xbmc.org/ticket/12074#comment:6

@elupus please comment/review. This might finally close a 1 year old bug ;)

I'm not quiet sure about the used time_base here (DVD_TIME_BASE). I thought packet pts was always using the stream time_base. I have tried that too (just by hardcoding it to num = 1 and den = 900000) - but this leads to async subs.