[Scummvm-git-logs] scummvm master -> ff1a9ac8d45d6335d75371ef91986700a2019500
eriktorbjorn
eriktorbjorn at telia.com
Mon Sep 19 07:26:56 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
579c024653 AUDIO: Keep packetized MP3 stream from ending prematurely
ff1a9ac8d4 FULLPIPE: Remove obsolete TODO comment
Commit: 579c024653e66fd4a08c91a80b34d3208e5faf6c
https://github.com/scummvm/scummvm/commit/579c024653e66fd4a08c91a80b34d3208e5faf6c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-09-19T07:25:55+02:00
Commit Message:
AUDIO: Keep packetized MP3 stream from ending prematurely
This fixes the audio in the intro AVI movie for German Fullpipe.
Changed paths:
audio/decoders/mp3.cpp
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index 36233a2..93c21b9 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -438,6 +438,7 @@ PacketizedMP3Stream::PacketizedMP3Stream(uint channels, uint rate) :
}
PacketizedMP3Stream::~PacketizedMP3Stream() {
+ Common::StackLock lock(_mutex);
while (!_queue.empty()) {
delete _queue.front();
_queue.pop();
@@ -447,12 +448,13 @@ PacketizedMP3Stream::~PacketizedMP3Stream() {
int PacketizedMP3Stream::readBuffer(int16 *buffer, const int numSamples) {
int samples = 0;
+ Common::StackLock lock(_mutex);
while (samples < numSamples) {
- Common::StackLock lock(_mutex);
-
- // Empty? Bail out for now
- if (_queue.empty())
+ // Empty? Bail out for now, and mark the stream as ended
+ if (_queue.empty()) {
+ _state = MP3_STATE_EOS;
return samples;
+ }
Common::SeekableReadStream *packet = _queue.front();
@@ -473,6 +475,12 @@ int PacketizedMP3Stream::readBuffer(int16 *buffer, const int numSamples) {
}
}
+ // This will happen if the audio runs out just as the last sample is
+ // decoded. But there may still be more audio queued up.
+ if (_state == MP3_STATE_EOS && !_queue.empty()) {
+ _state = MP3_STATE_READY;
+ }
+
return samples;
}
@@ -492,6 +500,12 @@ void PacketizedMP3Stream::queuePacket(Common::SeekableReadStream *packet) {
Common::StackLock lock(_mutex);
assert(!_finished);
_queue.push(packet);
+
+ // If the audio had finished (buffer underrun?), there is more to
+ // decode now.
+ if (_state == MP3_STATE_EOS) {
+ _state = MP3_STATE_READY;
+ }
}
void PacketizedMP3Stream::finish() {
Commit: ff1a9ac8d45d6335d75371ef91986700a2019500
https://github.com/scummvm/scummvm/commit/ff1a9ac8d45d6335d75371ef91986700a2019500
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-09-19T07:25:56+02:00
Commit Message:
FULLPIPE: Remove obsolete TODO comment
Changed paths:
engines/fullpipe/modal.cpp
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 1d1bbd0..8836429 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -233,8 +233,6 @@ void ModalIntro::finish() {
}
void ModalVideoPlayer::play(const char *filename) {
- // TODO: Videos are encoded using Intel Indeo 5 (IV50), which isn't supported yet
-
Video::AVIDecoder *aviDecoder = new Video::AVIDecoder();
if (!aviDecoder->loadFile(filename))
More information about the Scummvm-git-logs
mailing list