hrydgard/ppsspp — pull request #1940 by unknownbrackets (2013-05-27 01:11:49+00:00)
Title: Fix videos that never end

JPCSP seems to use "readLength" to track how much the decoder has read of the video stream. It translates this into packetsConsumed, basically, to tell the game how many packets were decoded/how many more it needs.

However, in our case, we don't populate that value (although we should when using ffmpeg, or we should do something similar.) Because of this, when it was decremented (to indicate the game had been told about that much read), it actually became negative.

Because of this, we stopped consuming packets if the pts didn't increase. Some games would stop calling GetAvcAu to wait for audio to catch up or w/e, and we would never consume packets, so it went into an infinite loop.

I went with a low number (4) for this case, but it should not affect games that were working before - at most it'll make the video a bit faster (it may fix subtitle timing I guess, not sure.) I tested with several of the games that are "mpeg fragile" and they all worked.

This fixes Ys 6 which now goes in game with default options.

-[Unknown]