aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorTorbjörn Andersson2019-01-18 19:19:25 +0100
committerFilippos Karapetis2019-02-10 16:32:02 +0200
commit9785d5007a7754ab988b51a8780d6a3dcc80dce4 (patch)
treec5c3b28c5846c7b65e9ceb0d24b667e9a2641540 /video
parent82a1859ad1105b2ae2cc3b15bfc3a92e3bc8736f (diff)
downloadscummvm-rg350-9785d5007a7754ab988b51a8780d6a3dcc80dce4.tar.gz
scummvm-rg350-9785d5007a7754ab988b51a8780d6a3dcc80dce4.tar.bz2
scummvm-rg350-9785d5007a7754ab988b51a8780d6a3dcc80dce4.zip
ZVISION: Boost volume for MPEG cutscenes
The high-resolution videos play back at much lower volume than the original ones. This adds hard-coded values for how much to amplify each cutscene. It's all done by ear, and it does introduce some clipping, but I think it should be acceptable. Of course, it could also be a problem with the audio decoder, so this may be the wrong approach entirely.
Diffstat (limited to 'video')
-rw-r--r--video/mpegps_decoder.cpp9
-rw-r--r--video/mpegps_decoder.h6
2 files changed, 9 insertions, 6 deletions
diff --git a/video/mpegps_decoder.cpp b/video/mpegps_decoder.cpp
index 361481b739..9b232ec792 100644
--- a/video/mpegps_decoder.cpp
+++ b/video/mpegps_decoder.cpp
@@ -50,7 +50,8 @@ enum {
kStartCodePrivateStream2 = 0x1BF
};
-MPEGPSDecoder::MPEGPSDecoder() {
+MPEGPSDecoder::MPEGPSDecoder(double decibel) {
+ _decibel = decibel;
_demuxer = new MPEGPSDemuxer();
}
@@ -104,7 +105,7 @@ MPEGPSDecoder::MPEGStream *MPEGPSDecoder::getStream(uint32 startCode, Common::Se
#ifdef USE_A52
handled = true;
- AC3AudioTrack *ac3Track = new AC3AudioTrack(*packet, getSoundType());
+ AC3AudioTrack *ac3Track = new AC3AudioTrack(*packet, _decibel, getSoundType());
stream = ac3Track;
_streamMap[startCode] = ac3Track;
addTrack(ac3Track);
@@ -704,9 +705,9 @@ Audio::AudioStream *MPEGPSDecoder::MPEGAudioTrack::getAudioStream() const {
#ifdef USE_A52
-MPEGPSDecoder::AC3AudioTrack::AC3AudioTrack(Common::SeekableReadStream &firstPacket, Audio::Mixer::SoundType soundType) :
+MPEGPSDecoder::AC3AudioTrack::AC3AudioTrack(Common::SeekableReadStream &firstPacket, double decibel, Audio::Mixer::SoundType soundType) :
AudioTrack(soundType) {
- _audStream = Audio::makeAC3Stream(firstPacket);
+ _audStream = Audio::makeAC3Stream(firstPacket, decibel);
if (!_audStream)
error("Could not create AC-3 stream");
}
diff --git a/video/mpegps_decoder.h b/video/mpegps_decoder.h
index bd703a35ff..7960639d78 100644
--- a/video/mpegps_decoder.h
+++ b/video/mpegps_decoder.h
@@ -54,7 +54,7 @@ namespace Video {
*/
class MPEGPSDecoder : public VideoDecoder {
public:
- MPEGPSDecoder();
+ MPEGPSDecoder(double decibel = 0.0);
virtual ~MPEGPSDecoder();
bool loadStream(Common::SeekableReadStream *stream);
@@ -166,7 +166,7 @@ private:
#ifdef USE_A52
class AC3AudioTrack : public AudioTrack, public MPEGStream {
public:
- AC3AudioTrack(Common::SeekableReadStream &firstPacket, Audio::Mixer::SoundType soundType);
+ AC3AudioTrack(Common::SeekableReadStream &firstPacket, double decibel, Audio::Mixer::SoundType soundType);
~AC3AudioTrack();
bool sendPacket(Common::SeekableReadStream *packet, uint32 pts, uint32 dts);
@@ -199,6 +199,8 @@ private:
// A map from stream types to stream handlers
typedef Common::HashMap<int, MPEGStream *> StreamMap;
StreamMap _streamMap;
+
+ double _decibel;
};
} // End of namespace Video