diff options
author | Matthew Hoops | 2011-04-14 10:31:20 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-04-14 10:31:20 -0400 |
commit | 3f124ae6bb77865a24dd84110a2d8008741b1d73 (patch) | |
tree | 7248a97b6b3b511e5f16c08762d2fd196b7e49d9 | |
parent | 76105b29b7f885ed873f6af7321d8e48a5b0a41e (diff) | |
download | scummvm-rg350-3f124ae6bb77865a24dd84110a2d8008741b1d73.tar.gz scummvm-rg350-3f124ae6bb77865a24dd84110a2d8008741b1d73.tar.bz2 scummvm-rg350-3f124ae6bb77865a24dd84110a2d8008741b1d73.zip |
VIDEO: Fix QuickTime videos without a video stream
Just in case anyone uses just that instead of Audio::makeQuickTimeStream()...
-rw-r--r-- | video/qt_decoder.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 8ff7c8a7a4..1ed99a701a 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -563,7 +563,10 @@ void QuickTimeDecoder::updateAudioBuffer() { uint32 numberOfChunksNeeded = 0; - if (_curFrame == (int32)_streams[_videoStreamIndex]->nb_frames - 1) { + if (_videoStreamIndex < 0 || _curFrame == (int32)_streams[_videoStreamIndex]->nb_frames - 1) { + // If we have no video, there's nothing to base our buffer against + // However, one must ask why a QuickTimeDecoder is being used instead of the nice makeQuickTimeStream() function + // If we're on the last frame, make sure all audio remaining is buffered numberOfChunksNeeded = _streams[_audioStreamIndex]->chunk_count; } else { |