Skip to content

Commit

Permalink
Update THPVideoDecode.c
Browse files Browse the repository at this point in the history
  • Loading branch information
EpochFlame committed Sep 13, 2023
1 parent 8dfff95 commit f10f4db
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/sysGCU/THPVideoDecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit f10f4db

Please sign in to comment.