Skip to content

Commit

Permalink
Merge pull request hrydgard#955 from raven02/patch-1
Browse files Browse the repository at this point in the history
Make UseMediaEngine check for couples of sceMpeg functions
  • Loading branch information
hrydgard committed Mar 12, 2013
2 parents b5e4d67 + 1593bc1 commit b438c45
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions Core/HLE/sceMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ struct Mp3Context {
p.DoMarker("Mp3Context");
}

int mp3StreamStart;
int mp3StreamEnd;
int mp3StreamPosition;
u64 mp3StreamStart;
u64 mp3StreamEnd;
u64 mp3StreamPosition;
u32 mp3Buf;
int mp3BufSize;
int mp3BufPendingSize;
Expand Down Expand Up @@ -399,6 +399,11 @@ void __MpegShutdown() {

u32 sceMpegInit()
{
if (!g_Config.bUseMediaEngine){
WARN_LOG(HLE, "Media Engine disabled");
return -1;
}

WARN_LOG(HLE, "sceMpegInit()");
return 0;
}
Expand All @@ -421,6 +426,11 @@ u32 sceMpegRingbufferConstruct(u32 ringbufferAddr, u32 numPackets, u32 data, u32

u32 sceMpegCreate(u32 mpegAddr, u32 dataPtr, u32 size, u32 ringbufferAddr, u32 frameWidth, u32 mode, u32 ddrTop)
{
if (!g_Config.bUseMediaEngine){
WARN_LOG(HLE, "Media Engine disabled");
return -1;
}

if (size < MPEG_MEMSIZE) {
WARN_LOG(HLE, "ERROR_MPEG_NO_MEMORY=sceMpegCreate(%08x, %08x, %i, %08x, %i, %i, %i)",
mpegAddr, dataPtr, size, ringbufferAddr, frameWidth, mode, ddrTop);
Expand Down Expand Up @@ -522,10 +532,6 @@ int sceMpegAvcDecodeMode(u32 mpeg, u32 modeAddr)

int sceMpegQueryStreamOffset(u32 mpeg, u32 bufferAddr, u32 offsetAddr)
{
if (!g_Config.bUseMediaEngine){
WARN_LOG(HLE, "Media Engine disabled");
return -1;
}
MpegContext *ctx = getMpegCtx(mpeg);
if (!ctx) {
WARN_LOG(HLE, "sceMpegQueryStreamOffset(%08x, %08x, %08x): bad mpeg handle", mpeg, bufferAddr, offsetAddr);
Expand Down Expand Up @@ -659,6 +665,11 @@ int sceMpegFreeAvcEsBuf(u32 mpeg, int esBuf)

u32 sceMpegAvcDecode(u32 mpeg, u32 auAddr, u32 frameWidth, u32 bufferAddr, u32 initAddr)
{
if (!g_Config.bUseMediaEngine){
WARN_LOG(HLE, "Media Engine disabled");
return -1;
}

MpegContext *ctx = getMpegCtx(mpeg);
if (!ctx) {
WARN_LOG(HLE, "sceMpegAvcDecode(%08x, %08x, %d, %08x, %08x): bad mpeg handle", mpeg, auAddr, frameWidth, bufferAddr, initAddr);
Expand Down Expand Up @@ -842,6 +853,11 @@ u32 sceMpegAvcDecodeStopYCbCr(u32 mpeg, u32 bufferAddr, u32 statusAddr)

int sceMpegAvcDecodeYCbCr(u32 mpeg, u32 auAddr, u32 bufferAddr, u32 initAddr)
{
if (!g_Config.bUseMediaEngine){
WARN_LOG(HLE, "Media Engine disabled");
return -1;
}

MpegContext *ctx = getMpegCtx(mpeg);
if (!ctx) {
WARN_LOG(HLE, "sceMpegAvcDecodeYCbCr(%08x, %08x, %08x, %08x): bad mpeg handle", mpeg, auAddr, bufferAddr, initAddr);
Expand Down

0 comments on commit b438c45

Please sign in to comment.