xbmc/xbmc — pull request #3645 by whaupt (2013-11-14 10:03:17+00:00)
Title: [dvdplayer] prevent rendering of frames with negative pts

I have a kinda strange video file:
https://dl.dropboxusercontent.com/u/27828013/cur_vid1.mov

I've exported it via iPhone AVAssetExportSession and told it to extract from second 30 to second 60.
When I play the file with XBMC it's seeking at the beginning of the video.
This does not happen with Quicktimeplayer.

After some investigation I found following reason:
The video is h264 encoded and there is no IDR-Frame at second 30. So the AVAssetExportSession extracts from the first IDR-Frame before second 30. Which is in my case second 23.
If I check the file with ffprobe it shows starttime = -7,6.
I guessed XBMC starts playing from -7,6 which seems not right to me, IMO it should start at 0.
So I tried to skip rendering for frames with a pts < 0.

I'm pretty sure my changes break something. Can anyone give me feedback, I don't understand the logic in ConvertTimestamp.