From c78a63460be88bce41125f8555bf1d5ffdfa9ad0 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 6 Sep 2010 18:15:51 +0000 Subject: VIDEO: Skip multiple tags in a QuickTime stsd entry Fixes crashes when playing two videos in Riven DVD (card 262). Note that the videos still don't display properly because of a bug in QTRLE 16bpp. For the record, FFmpeg doesn't handle this properly either. svn-id: r52603 --- graphics/video/qt_decoder.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'graphics') diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp index 3cdb82fb10..8437f0af43 100644 --- a/graphics/video/qt_decoder.cpp +++ b/graphics/video/qt_decoder.cpp @@ -811,6 +811,17 @@ int QuickTimeDecoder::readSTSD(MOVatom atom) { _fd->readUint16BE(); // index debug(0, "size=%d 4CC= %s codec_type=%d", size, tag2str(format), st->codec_type); + + if (st->codec_tag && st->codec_tag != format) { + // HACK: Multiple FourCC, skip this. FFmpeg does this too and also + // skips it with a TODO. However, we really don't need to support + // multiple codec tags since the only two videos in Riven DVD that + // do this just have a fake second stream (or so it seems). + debug(3, "Multiple FourCC not supported"); + _fd->seek(start_pos + size); + continue; + } + st->codec_tag = format; if (st->codec_type == CODEC_TYPE_VIDEO) { -- cgit v1.2.3