[Scummvm-git-logs] scummvm master -> d3afd13866e5a779c1ab0db55f7fd01443bf23e4

sev- noreply at scummvm.org
Tue Jun 10 12:35:44 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
d3afd13866 VIDEO: MPEGPS: Check if packet's pts is large enough before offsetting


Commit: d3afd13866e5a779c1ab0db55f7fd01443bf23e4
    https://github.com/scummvm/scummvm/commit/d3afd13866e5a779c1ab0db55f7fd01443bf23e4
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2025-06-10T14:35:40+02:00

Commit Message:
VIDEO: MPEGPS: Check if packet's pts is large enough before offsetting

Changed paths:
    video/mpegps_decoder.cpp


diff --git a/video/mpegps_decoder.cpp b/video/mpegps_decoder.cpp
index 734a610cbfa..03b57d6bfbe 100644
--- a/video/mpegps_decoder.cpp
+++ b/video/mpegps_decoder.cpp
@@ -342,7 +342,8 @@ Common::SeekableReadStream *MPEGPSDecoder::MPEGPSDemuxer::getNextPacket(uint32 c
 			// time stamp.
 			usePacket = true;
 		} else {
-			packet._pts -= _firstAudioPacketPts;
+			if (packet._pts >= _firstAudioPacketPts)
+				packet._pts -= _firstAudioPacketPts;
 			uint32 packetTime = packet._pts / 90;
 			if (packetTime <= currentTime || packetTime - currentTime < AUDIO_THRESHOLD || _videoQueue.empty()) {
 				// The packet is overdue, or will be soon.
@@ -369,7 +370,7 @@ Common::SeekableReadStream *MPEGPSDecoder::MPEGPSDemuxer::getNextPacket(uint32 c
 		Packet packet = _videoQueue.pop();
 		startCode = packet._startCode;
 
-		if (packet._pts != 0xFFFFFFFF) {
+		if (packet._pts != 0xFFFFFFFF && packet._pts >= _firstVideoPacketPts) {
 			packet._pts -= _firstVideoPacketPts;
 		}
 		pts = packet._pts;




More information about the Scummvm-git-logs mailing list