From 68b99f1c9585e073b66286a2a05dce71bde81263 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 28 Nov 2009 00:38:18 +0000 Subject: Adding a parameter to the AviDecoder constructor to allow changing the SoundType (instead of it being fixed to Plain) svn-id: r46170 --- graphics/video/avi_decoder.cpp | 6 ++++-- graphics/video/avi_decoder.h | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/video/avi_decoder.cpp b/graphics/video/avi_decoder.cpp index c28a6342de..5eb4d3988f 100644 --- a/graphics/video/avi_decoder.cpp +++ b/graphics/video/avi_decoder.cpp @@ -39,7 +39,9 @@ namespace Graphics { -AviDecoder::AviDecoder(Audio::Mixer *mixer) : _mixer(mixer) { +AviDecoder::AviDecoder(Audio::Mixer *mixer, Audio::Mixer::SoundType soundType) : _mixer(mixer) { + _soundType = soundType; + _videoCodec = NULL; _decodedHeader = false; _audStream = NULL; @@ -241,7 +243,7 @@ bool AviDecoder::loadFile(const char *fileName) { // Initialize the video stuff too _audStream = createAudioStream(); if (_audStream) - _mixer->playInputStream(Audio::Mixer::kPlainSoundType, _audHandle, _audStream); + _mixer->playInputStream(_soundType, _audHandle, _audStream); debug (0, "Frames = %d, Dimensions = %d x %d", _header.totalFrames, _header.width, _header.height); debug (0, "Frame Rate = %d", getFrameRate()); diff --git a/graphics/video/avi_decoder.h b/graphics/video/avi_decoder.h index 25e13873b6..c4dbb0d41d 100644 --- a/graphics/video/avi_decoder.h +++ b/graphics/video/avi_decoder.h @@ -174,7 +174,8 @@ struct AVIStreamHeader { class AviDecoder : public VideoDecoder { public: - AviDecoder(Audio::Mixer *mixer); + AviDecoder(Audio::Mixer *mixer, + Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType); virtual ~AviDecoder(); /** @@ -207,6 +208,8 @@ private: Codec *_videoCodec; Codec *createCodec(); + Audio::Mixer::SoundType _soundType; + void runHandle(uint32 tag); void handleList(); void handleStreamHeader(); -- cgit v1.2.3