Skip to content

Commit

Permalink
Don't skip the first psmf frame when syncing audio.
Browse files Browse the repository at this point in the history
Fixes #6374.
  • Loading branch information
unknownbrackets committed Jun 20, 2014
1 parent 43e5ac9 commit ae13d51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Core/HLE/scePsmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,8 @@ int scePsmfPlayerGetVideoData(u32 psmfPlayer, u32 videoDataAddr)
doVideoStep = false;
} else if (!psmfplayer->mediaengine->IsNoAudioData()) {
s64 deltapts = psmfplayer->mediaengine->getVideoTimeStamp() - psmfplayer->mediaengine->getAudioTimeStamp();
if (deltapts > 0) {
// Don't skip the very first frame, sometimes audio starts with an early timestamp.
if (deltapts > 0 && psmfplayer->mediaengine->getVideoTimeStamp() > 0) {
// Don't advance, just return the same frame again.
// TODO: This also seems somewhat based on Update() calls, but audio is involved too...
doVideoStep = false;
Expand All @@ -1501,7 +1502,7 @@ int scePsmfPlayerGetVideoData(u32 psmfPlayer, u32 videoDataAddr)
}
} else {
// No audio, based on Update() calls. playSpeed doesn't seem to matter?
if (psmfplayer->videoStep <= 1) {
if (psmfplayer->videoStep <= 1 && psmfplayer->mediaengine->getVideoTimeStamp() > 0) {
doVideoStep = false;
} else {
psmfplayer->videoStep = 0;
Expand Down

0 comments on commit ae13d51

Please sign in to comment.