[Scummvm-git-logs] scummvm master -> a2db7e5ac6b3a5600d01e11422c57e80de8fe260
sev-
noreply at scummvm.org
Mon Jul 13 20:20:56 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a2db7e5ac6 VIDEO: Support audio-only AVI files
Commit: a2db7e5ac6b3a5600d01e11422c57e80de8fe260
https://github.com/scummvm/scummvm/commit/a2db7e5ac6b3a5600d01e11422c57e80de8fe260
Author: Scorp (scorp at mrs.mn)
Date: 2026-07-13T22:20:50+02:00
Commit Message:
VIDEO: Support audio-only AVI files
Allow AVIDecoder to load AVI files that contain supported audio tracks but no video tracks. Avoid video-track assumptions while reading packets and while checking for Truemotion-specific video handling.
Changed paths:
video/avi_decoder.cpp
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 78c8214841e..e1efb73cd35 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -462,8 +462,16 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
;
if (_decodedHeader) {
- // Ensure there's at least a supported video track
- _decodedHeader = findNextVideoTrack() != nullptr;
+ // Ensure there's at least one supported media track. Some AVI files
+ // carry only audio data, which is still valid for MCI-style playback.
+ bool hasSupportedTrack = false;
+ for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++) {
+ if ((*it)->getTrackType() == Track::kTrackTypeVideo || (*it)->getTrackType() == Track::kTrackTypeAudio) {
+ hasSupportedTrack = true;
+ break;
+ }
+ }
+ _decodedHeader = hasSupportedTrack;
}
if (!_decodedHeader) {
@@ -535,7 +543,7 @@ void AVIDecoder::close() {
void AVIDecoder::readNextPacket() {
// Shouldn't get this unless called on a non-open video
- if (_videoTracks.empty())
+ if (_videoTracks.empty() && _audioTracks.empty())
return;
// Handle the video first
@@ -650,6 +658,9 @@ bool AVIDecoder::shouldQueueAudio(TrackStatus& status) {
if (status.track->getTrackType() != Track::kTrackTypeAudio)
return false;
+ if (_videoTracks.empty())
+ return true;
+
// If video is done, make sure that the rest of the audio is queued
// (I guess this is also really a sanity check)
AVIVideoTrack *videoTrack = (AVIVideoTrack *)_videoTracks[0].track;
@@ -923,8 +934,8 @@ void AVIDecoder::readOldIndex(uint32 size) {
}
void AVIDecoder::checkTruemotion1() {
- // If we got here from loadStream(), we know the track is valid
- assert(!_videoTracks.empty());
+ if (_videoTracks.empty())
+ return;
TrackStatus &status = _videoTracks[0];
AVIVideoTrack *track = (AVIVideoTrack *)status.track;
More information about the Scummvm-git-logs
mailing list