diff options
author | Matthew Hoops | 2012-07-21 17:11:09 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-07-21 17:11:09 -0400 |
commit | 1d565a26610a174c16b58b569fe413f3acf9bd75 (patch) | |
tree | 788c25c10f2bc4f91154eadcefee33742e364eac | |
parent | c3cc3620c0d66a2ea7eac9738ead934f3b6381b0 (diff) | |
download | scummvm-rg350-1d565a26610a174c16b58b569fe413f3acf9bd75.tar.gz scummvm-rg350-1d565a26610a174c16b58b569fe413f3acf9bd75.tar.bz2 scummvm-rg350-1d565a26610a174c16b58b569fe413f3acf9bd75.zip |
VIDEO: Fix volume/balance settings in AdvancedVideoDecoder
-rw-r--r-- | video/video_decoder.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 67e53c6b47..07fd225dcf 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -98,6 +98,9 @@ AdvancedVideoDecoder::AdvancedVideoDecoder() { _dirtyPalette = false; _palette = 0; _isPlaying = false; + _audioVolume = Audio::Mixer::kMaxChannelVolume; + _audioBalance = 0; + _pauseLevel = 0; } void AdvancedVideoDecoder::close() { @@ -112,7 +115,9 @@ void AdvancedVideoDecoder::close() { _dirtyPalette = false; _palette = 0; _startTime = 0; - reset(); + _audioVolume = Audio::Mixer::kMaxChannelVolume; + _audioBalance = 0; + _pauseLevel = 0; } bool AdvancedVideoDecoder::isVideoLoaded() const { @@ -482,9 +487,17 @@ bool AdvancedVideoDecoder::SeekableAudioTrack::seek(const Audio::Timestamp &time void AdvancedVideoDecoder::addTrack(Track *track) { _tracks.push_back(track); + // Update volume settings if it's an audio track + if (track->getTrackType() == Track::kTrackTypeAudio) { + ((AudioTrack *)track)->setVolume(_audioVolume); + ((AudioTrack *)track)->setBalance(_audioBalance); + } + + // Keep the track paused if we're paused if (isPaused()) track->pause(true); + // Start the track if we're playing if (isPlaying()) track->start(); } |