mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 11:36:22 +00:00
VIDEO: Synchronize video to pts timestamps
This is another attempts at improving the audio/video sync in the MPEG-PS decoder. Unfortunately, the audio probably also needs to be synced to its pts timestamps...
This commit is contained in:
parent
d4f8b330d6
commit
b672a694b9
@ -486,6 +486,10 @@ bool MPEGPSDecoder::MPEGVideoTrack::sendPacket(Common::SeekableReadStream *packe
|
||||
|
||||
if (foundFrame) {
|
||||
_curFrame++;
|
||||
if (pts != 0xFFFFFFFF) {
|
||||
Audio::Timestamp ptsTimestamp = Audio::Timestamp(pts / 90, 27000000);
|
||||
framePeriod = ptsTimestamp.frameDiff(_nextFrameStartTime);
|
||||
}
|
||||
_nextFrameStartTime = _nextFrameStartTime.addFrames(framePeriod);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user