VIDEO: Make the video pts sync easier to understand
This commit is contained in:
parent
b672a694b9
commit
ac40828ed2
1 changed files with 8 additions and 3 deletions
|
@ -486,11 +486,16 @@ bool MPEGPSDecoder::MPEGVideoTrack::sendPacket(Common::SeekableReadStream *packe
|
||||||
|
|
||||||
if (foundFrame) {
|
if (foundFrame) {
|
||||||
_curFrame++;
|
_curFrame++;
|
||||||
|
|
||||||
|
// If there is a presentation timestamp, use that for sync. Almost all
|
||||||
|
// packets with a presentation timestamp will have a found frame, so
|
||||||
|
// it is probably not worth the trouble worrying about when they don't.
|
||||||
|
|
||||||
if (pts != 0xFFFFFFFF) {
|
if (pts != 0xFFFFFFFF) {
|
||||||
Audio::Timestamp ptsTimestamp = Audio::Timestamp(pts / 90, 27000000);
|
_nextFrameStartTime = Audio::Timestamp(pts / 90, 27000000);
|
||||||
framePeriod = ptsTimestamp.frameDiff(_nextFrameStartTime);
|
} else {
|
||||||
|
_nextFrameStartTime = _nextFrameStartTime.addFrames(framePeriod);
|
||||||
}
|
}
|
||||||
_nextFrameStartTime = _nextFrameStartTime.addFrames(framePeriod);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue