VIDEO: Fix QuickTime decoding when color depth is 32
Color depths greater than 32 have grayscale bit 0x20 set, but the decoder incorrectly treats 32 as grayscale and and clears the bit, leaving the color depth as zero and causing codecs to fail. Confirmed correct behavior in the ffmpeg code that the decoder was based off. The decoder was introduced with the Mohawk engine in 2009,so presumably no Mohawk movies had color depth 32. Fixes videos in the Director game Virtual Cocktail Bar
This commit is contained in:
parent
4180555675
commit
cdd463a37a
1 changed files with 3 additions and 1 deletions
|
@ -201,6 +201,8 @@ Common::QuickTimeParser::SampleDesc *QuickTimeDecoder::readSampleDesc(Common::Qu
|
|||
_fd->readByte();
|
||||
}
|
||||
}
|
||||
|
||||
entry->_bitsPerSample &= 0x1f; // clear grayscale bit
|
||||
}
|
||||
|
||||
return entry;
|
||||
|
@ -272,7 +274,7 @@ QuickTimeDecoder::VideoSampleDesc::~VideoSampleDesc() {
|
|||
}
|
||||
|
||||
void QuickTimeDecoder::VideoSampleDesc::initCodec() {
|
||||
_videoCodec = Image::createQuickTimeCodec(_codecTag, _parentTrack->width, _parentTrack->height, _bitsPerSample & 0x1f);
|
||||
_videoCodec = Image::createQuickTimeCodec(_codecTag, _parentTrack->width, _parentTrack->height, _bitsPerSample);
|
||||
}
|
||||
|
||||
QuickTimeDecoder::AudioTrackHandler::AudioTrackHandler(QuickTimeDecoder *decoder, QuickTimeAudioTrack *audioTrack) :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue