From f10f4dbeb3021f9902bdad66a5023b0b8a7aff50 Mon Sep 17 00:00:00 2001 From: EpochFlame Date: Tue, 12 Sep 2023 22:19:28 -0400 Subject: [PATCH] Update THPVideoDecode.c --- src/sysGCU/THPVideoDecode.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sysGCU/THPVideoDecode.c b/src/sysGCU/THPVideoDecode.c index 3a721c5ac..e85ccded5 100644 --- a/src/sysGCU/THPVideoDecode.c +++ b/src/sysGCU/THPVideoDecode.c @@ -85,8 +85,9 @@ static void* VideoDecoder(void* arg) VideoDecode(thpBuffer); PushFreeReadBuffer((OSMessage*)thpBuffer); - OSDisableInterrupts(); - OSRestoreInterrupts(ActivePlayer.mVideoDecodeCount++); // regswap r3/r4 here + BOOL interrupt = OSDisableInterrupts(); + ActivePlayer.mVideoDecodeCount++; + OSRestoreInterrupts(interrupt); } } @@ -119,8 +120,9 @@ static void* VideoDecoderForOnMemory(void* arg) readBuffer.mPtr = (u8*)arg; while (TRUE) { if (ActivePlayer.mAudioExist) { - OSDisableInterrupts(); - OSRestoreInterrupts(ActivePlayer.mVideoDecodeCount++); // regswap r3/r4 here + BOOL interrupt = OSDisableInterrupts(); + ActivePlayer.mVideoDecodeCount++; + OSRestoreInterrupts(interrupt); while (i--) { ActivePlayer.mVideoDecodeCount++; s32 remaining = (frame + ActivePlayer.mInitReadFrame) % ActivePlayer.mHeader.mNumFrames; @@ -191,8 +193,9 @@ static void VideoDecode(THPReadBuffer* readBuffer) } textureSet->mFrameNumber = readBuffer->mFrameNumber; PushDecodedTextureSet((OSMessage*)textureSet); - OSDisableInterrupts(); - OSRestoreInterrupts(ActivePlayer.mVideoDecodeCount++); // regswap r3/r4 here + BOOL interrupt = OSDisableInterrupts(); + ActivePlayer.mVideoDecodeCount++; + OSRestoreInterrupts(interrupt); } }