diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index cbb655398a..fb3ad8867a 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1633,7 +1633,7 @@ static int sceMpegQueryPcmEsSize(u32 mpeg, u32 esSizeAddr, u32 outSizeAddr) return -1; } - ERROR_LOG(ME, "sceMpegQueryPcmEsSize - bad pointers(%08x, %08x, %08x)", mpeg, esSizeAddr, outSizeAddr); + ERROR_LOG(ME, "sceMpegQueryPcmEsSize(%08x, %08x, %08x)", mpeg, esSizeAddr, outSizeAddr); Memory::Write_U32(MPEG_PCM_ES_SIZE, esSizeAddr); Memory::Write_U32(MPEG_PCM_ES_OUTPUT_SIZE, outSizeAddr); @@ -1646,13 +1646,20 @@ static u32 sceMpegChangeGetAuMode(u32 mpeg, int streamUid, int mode) MpegContext *ctx = getMpegCtx(mpeg); if (!ctx) { 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? - StreamInfo info = {0}; - info.sid = streamUid; - if (info.sid) { + auto stream = ctx->streamMap.find(streamUid); + if (stream == ctx->streamMap.end()) { + ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i, %i): unknown streamID", mpeg, streamUid, mode); + 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) { case MPEG_AVC_STREAM: if (mode == MPEG_AU_MODE_DECODE) { @@ -1677,11 +1684,9 @@ static u32 sceMpegChangeGetAuMode(u32 mpeg, int streamUid, int mode) } break; 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; } - } else { - ERROR_LOG(ME, "UNIMPL sceMpegChangeGetAuMode(%08x, %i): unknown streamID", mpeg, streamUid); } return 0; } diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index f1d7989583..84f6716ee9 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -482,6 +482,17 @@ void MediaEngine::updateSwsFormat(int videoPixelMode) { NULL, NULL ); + + int *inv_coefficients; + int *coefficients; + int srcRange, dstRange; + int brightness, contrast, saturation; + + if (sws_getColorspaceDetails(m_sws_ctx, &inv_coefficients, &srcRange, &coefficients, &dstRange, &brightness, &contrast, &saturation) != -1) { + srcRange = 0; + dstRange = 0; + sws_setColorspaceDetails(m_sws_ctx, inv_coefficients, srcRange, coefficients, dstRange, brightness, contrast, saturation); + } } #endif }