mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Don't zero paused, but do zero end in psmfplayer.
To make sure the video/audio sync up. If an audio frame was already decoded, it should technically be returned, but after that it will return an error.
This commit is contained in:
parent
222be04b38
commit
d4e548013e
1 changed files with 7 additions and 6 deletions
|
@ -1561,16 +1561,17 @@ int scePsmfPlayerGetAudioData(u32 psmfPlayer, u32 audioDataAddr)
|
|||
|
||||
if (psmfplayer->playMode == PSMF_PLAYER_MODE_PAUSE) {
|
||||
INFO_LOG(HLE, "scePsmfPlayerGetAudioData(%08x): paused mode", psmfPlayer);
|
||||
// Clear the audio when paused.
|
||||
if (Memory::IsValidAddress(audioDataAddr)) {
|
||||
Memory::Memset(audioDataAddr, 0, audioSamplesBytes);
|
||||
}
|
||||
return 0;
|
||||
return ERROR_PSMFPLAYER_NO_MORE_DATA;
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
if (psmfplayer->mediaengine->getAudioSamples(audioDataAddr) == 0) {
|
||||
ret = (int)ERROR_PSMFPLAYER_NO_MORE_DATA;
|
||||
if (psmfplayer->totalAudioStreams > 0 && psmfplayer->psmfPlayerAvcAu.pts < psmfplayer->totalDurationTimestamp - VIDEO_FRAME_DURATION_TS) {
|
||||
// Write zeros for any missing trailing frames so it syncs with the video.
|
||||
Memory::Memset(audioDataAddr, 0, audioSamplesBytes);
|
||||
} else {
|
||||
ret = (int)ERROR_PSMFPLAYER_NO_MORE_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(ME, "%08x=scePsmfPlayerGetAudioData(%08x, %08x)", ret, psmfPlayer, audioDataAddr);
|
||||
|
|
Loading…
Add table
Reference in a new issue