Since we don't use readlength yet, don't add it.

This would actually go negative often enough, making us consume packets
more slowly than we should, or even never finish consuming.  4 is probably
too small, though.
This commit is contained in:
Unknown W. Brackets 2013-05-26 17:59:13 -07:00
parent 66129b69e8
commit 4f069a23d9

View File

@ -659,7 +659,11 @@ u32 sceMpegAvcDecode(u32 mpeg, u32 auAddr, u32 frameWidth, u32 bufferAddr, u32 i
if (ctx->mediaengine->stepVideo()) {
ctx->mediaengine->writeVideoImage(buffer, frameWidth, ctx->videoPixelMode);
packetsConsumed += ctx->mediaengine->readLength() / ringbuffer.packetSize;
// TODO: The idea here is to consume packets based on actual decoded bytes.
// We don't actually decode anything (readLength is always 0), so hardcoded for now.
//packetsConsumed = ctx->mediaengine->readLength() / ringbuffer.packetSize;
if (packetsConsumed == 0)
packetsConsumed = std::min(packetsInRingBuffer, 4);
// The MediaEngine is already consuming all the remaining
// packets when approaching the end of the video. The PSP
@ -840,7 +844,12 @@ int sceMpegAvcDecodeYCbCr(u32 mpeg, u32 auAddr, u32 bufferAddr, u32 initAddr)
if (ctx->mediaengine->stepVideo()) {
// TODO: Write it somewhere or buffer it or something?
packetsConsumed += ctx->mediaengine->readLength() / ringbuffer.packetSize;
// TODO: The idea here is to consume packets based on actual decoded bytes.
// We don't actually decode anything (readLength is always 0), so hardcoded for now.
//packetsConsumed = ctx->mediaengine->readLength() / ringbuffer.packetSize;
if (packetsConsumed == 0)
packetsConsumed = std::min(packetsInRingBuffer, 4);
// Consuming all the remaining packets?
if (ringbuffer.packetsFree + packetsConsumed >= ringbuffer.packets) {