Make sceMpegChangeGetAuMode() operate more sanely.

I'm pretty sure this is what the intention was before, but it still
doesn't do anything useful (since ignore* are... ignored.)
This commit is contained in:
Unknown W. Brackets 2015-03-01 09:26:53 -08:00
parent f312925374
commit d49010832c

View File

@ -1646,13 +1646,20 @@ static u32 sceMpegChangeGetAuMode(u32 mpeg, int streamUid, int mode)
MpegContext *ctx = getMpegCtx(mpeg); MpegContext *ctx = getMpegCtx(mpeg);
if (!ctx) { if (!ctx) {
WARN_LOG(ME, "sceMpegChangeGetAuMode(%08x, %i, %i): bad mpeg handle", mpeg, streamUid, mode); WARN_LOG(ME, "sceMpegChangeGetAuMode(%08x, %i, %i): bad mpeg handle", mpeg, streamUid, mode);
return -1; return ERROR_MPEG_INVALID_VALUE;
}
if (mode != MPEG_AU_MODE_DECODE && mode != MPEG_AU_MODE_SKIP) {
ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i, %i): bad mode", mpeg, streamUid, mode);
return ERROR_MPEG_INVALID_VALUE;
} }
// NOTE: Where is the info supposed to come from? auto stream = ctx->streamMap.find(streamUid);
StreamInfo info = {0}; if (stream == ctx->streamMap.end()) {
info.sid = streamUid; ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i, %i): unknown streamID", mpeg, streamUid, mode);
if (info.sid) { return ERROR_MPEG_INVALID_VALUE;
} else {
StreamInfo &info = stream->second;
DEBUG_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i, %i): changing type=%d", mpeg, streamUid, mode, info.type);
switch (info.type) { switch (info.type) {
case MPEG_AVC_STREAM: case MPEG_AVC_STREAM:
if (mode == MPEG_AU_MODE_DECODE) { if (mode == MPEG_AU_MODE_DECODE) {
@ -1677,11 +1684,9 @@ static u32 sceMpegChangeGetAuMode(u32 mpeg, int streamUid, int mode)
} }
break; break;
default: default:
ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i): unknown streamID", mpeg, streamUid); ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i, %i): unknown streamID", mpeg, streamUid, mode);
break; break;
} }
} else {
ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i): unknown streamID", mpeg, streamUid);
} }
return 0; return 0;
} }