aboutsummaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorTorbjörn Andersson2018-05-29 19:56:55 +0200
committerThierry Crozat2018-11-04 22:33:22 +0100
commitd4f8b330d61cb2457fa1c085510a5f0553b98d97 (patch)
tree654b1427f21673b8e168774e25edb083712bfd0d /image
parent43b29a93d7920480081f8cf8ab8b59fb946a8d98 (diff)
downloadscummvm-rg350-d4f8b330d61cb2457fa1c085510a5f0553b98d97.tar.gz
scummvm-rg350-d4f8b330d61cb2457fa1c085510a5f0553b98d97.tar.bz2
scummvm-rg350-d4f8b330d61cb2457fa1c085510a5f0553b98d97.zip
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.
Diffstat (limited to 'image')
-rw-r--r--image/codecs/mpeg.cpp5
1 files changed, 5 insertions, 0 deletions
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