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:
Torbjörn Andersson 2018-06-10 09:09:46 +02:00 committed by Thierry Crozat
parent d4f8b330d6
commit b672a694b9

View File

@ -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