From d4f8b330d61cb2457fa1c085510a5f0553b98d97 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 29 May 2018 19:56:55 +0200 Subject: IMAGE: Honor nb_fields when calculating frame duration From what I understand, this has something to do with the image being either made up from two or three parts. When it's made from three parts, the frame should be displayed for half again as long as normal. This makes the speed of the Zork: Grand Inquisitor video look about right to me. It's still out of sync, but it doesn't seem to get *more* out of sync as the video progresses. --- image/codecs/mpeg.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'image/codecs') diff --git a/image/codecs/mpeg.cpp b/image/codecs/mpeg.cpp index beb042dbf1..bb40fe615d 100644 --- a/image/codecs/mpeg.cpp +++ b/image/codecs/mpeg.cpp @@ -78,8 +78,13 @@ bool MPEGDecoder::decodePacket(Common::SeekableReadStream &packet, uint32 &frame if (_mpegInfo->display_fbuf) { foundFrame = true; const mpeg2_sequence_t *sequence = _mpegInfo->sequence; + const mpeg2_picture_t *picture = _mpegInfo->display_picture; framePeriod += sequence->frame_period; + if (picture->nb_fields > 2) { + framePeriod += (sequence->frame_period / 2); + + } if (!dst) { // If no destination is specified, use our internal storage -- cgit v1.2.3