aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
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();