aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-08-06 13:59:55 +0200
committerThierry Crozat2018-11-04 22:33:22 +0100
commitef70af5e991e0c60465385c9a84bdefdd54f9bd2 (patch)
tree24d2d9eddf9842857244c7ac8ec786e99c5e0f6c /video
parente6abe39752c694ec0f873825a7465a00adc57ffe (diff)
downloadscummvm-rg350-ef70af5e991e0c60465385c9a84bdefdd54f9bd2.tar.gz
scummvm-rg350-ef70af5e991e0c60465385c9a84bdefdd54f9bd2.tar.bz2
scummvm-rg350-ef70af5e991e0c60465385c9a84bdefdd54f9bd2.zip
VIDEO: Some minor cleanups to the AC-3 decoder
Diffstat (limited to 'video')
-rw-r--r--video/mpegps_decoder.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/video/mpegps_decoder.cpp b/video/mpegps_decoder.cpp
index 0d91bbe04b..f4addf9baa 100644
--- a/video/mpegps_decoder.cpp
+++ b/video/mpegps_decoder.cpp
@@ -555,9 +555,10 @@ MPEGPSDecoder::AC3AudioTrack::AC3AudioTrack(Common::SeekableReadStream *firstPac
_audStream = Audio::makeQueuingAudioStream(_sampleRate, true);
} else {
_audStream = 0;
- firstPacket->seek(0);
}
+ firstPacket->seek(0);
+
_inBufPtr = _inBuf;
_flags = 0;
_frameSize = 0;
@@ -580,8 +581,12 @@ Audio::AudioStream *MPEGPSDecoder::AC3AudioTrack::getAudioStream() const {
return _audStream;
}
+enum {
+ HEADER_SIZE = 7
+};
+
void MPEGPSDecoder::AC3AudioTrack::initStream(Common::SeekableReadStream *packet) {
- byte buf[7];
+ byte buf[HEADER_SIZE];
_sampleRate = -1;
@@ -597,14 +602,8 @@ void MPEGPSDecoder::AC3AudioTrack::initStream(Common::SeekableReadStream *packet
break;
}
}
-
- packet->seek(0, SEEK_SET);
}
-enum {
- HEADER_SIZE = 7
-};
-
void MPEGPSDecoder::AC3AudioTrack::decodeAC3Data(Common::SeekableReadStream *packet) {
// Skip the DVD code
packet->readUint32LE();