[Scummvm-cvs-logs] scummvm master -> 3dc9b75dfcc9cde14bb56231ab222615f64121f2
lordhoto
lordhoto at gmail.com
Mon Aug 4 15:38:38 CEST 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8564c7ec0a AUDIO: Increment total play time when decoding MP3 data.
1d12bddd63 AUDIO: Rename MP3Stream's _totalTime to _curTime to better reflect the variable's purpose.
3dc9b75dfc Merge pull request #485 from Akz-/mp3-seeking-fix
Commit: 8564c7ec0ae4f7a610e977ba8f84eeb2626d3d9d
https://github.com/scummvm/scummvm/commit/8564c7ec0ae4f7a610e977ba8f84eeb2626d3d9d
Author: Joni Vähämäki (jonivah at gmail.com)
Date: 2014-07-26T14:30:56+03:00
Commit Message:
AUDIO: Increment total play time when decoding MP3 data.
Changed paths:
audio/decoders/mp3.cpp
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index 091f645..f66b20e 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -166,6 +166,8 @@ void MP3Stream::decodeMP3Data() {
}
}
+ // Sum up the total playback time so far
+ mad_timer_add(&_totalTime, _frame.header.duration);
// Synthesize PCM data
mad_synth_frame(&_synth, &_frame);
_posInFrame = 0;
Commit: 1d12bddd6399ae30f00966703373bd4a90b9c423
https://github.com/scummvm/scummvm/commit/1d12bddd6399ae30f00966703373bd4a90b9c423
Author: Joni Vähämäki (jonivah at gmail.com)
Date: 2014-08-01T01:43:04+03:00
Commit Message:
AUDIO: Rename MP3Stream's _totalTime to _curTime to better reflect the variable's purpose.
Changed paths:
audio/decoders/mp3.cpp
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index f66b20e..c1b3faa 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -59,7 +59,7 @@ protected:
State _state;
Timestamp _length;
- mad_timer_t _totalTime;
+ mad_timer_t _curTime;
mad_stream _stream;
mad_frame _frame;
@@ -99,7 +99,7 @@ MP3Stream::MP3Stream(Common::SeekableReadStream *inStream, DisposeAfterUse::Flag
_posInFrame(0),
_state(MP3_STATE_INIT),
_length(0, 1000),
- _totalTime(mad_timer_zero) {
+ _curTime(mad_timer_zero) {
// The MAD_BUFFER_GUARD must always contain zeros (the reason
// for this is that the Layer III Huffman decoder of libMAD
@@ -119,7 +119,7 @@ MP3Stream::MP3Stream(Common::SeekableReadStream *inStream, DisposeAfterUse::Flag
// Note that we allow "MAD_ERROR_BUFLEN" as error code here, since according
// to mad.h it is also set on EOF.
if ((_stream.error == MAD_ERROR_NONE || _stream.error == MAD_ERROR_BUFLEN) && getRate() > 0)
- _length = Timestamp(mad_timer_count(_totalTime, MAD_UNITS_MILLISECONDS), getRate());
+ _length = Timestamp(mad_timer_count(_curTime, MAD_UNITS_MILLISECONDS), getRate());
deinitStream();
@@ -167,7 +167,7 @@ void MP3Stream::decodeMP3Data() {
}
// Sum up the total playback time so far
- mad_timer_add(&_totalTime, _frame.header.duration);
+ mad_timer_add(&_curTime, _frame.header.duration);
// Synthesize PCM data
mad_synth_frame(&_synth, &_frame);
_posInFrame = 0;
@@ -222,10 +222,10 @@ bool MP3Stream::seek(const Timestamp &where) {
mad_timer_t destination;
mad_timer_set(&destination, time / 1000, time % 1000, 1000);
- if (_state != MP3_STATE_READY || mad_timer_compare(destination, _totalTime) < 0)
+ if (_state != MP3_STATE_READY || mad_timer_compare(destination, _curTime) < 0)
initStream();
- while (mad_timer_compare(destination, _totalTime) > 0 && _state != MP3_STATE_EOS)
+ while (mad_timer_compare(destination, _curTime) > 0 && _state != MP3_STATE_EOS)
readHeader();
decodeMP3Data();
@@ -244,7 +244,7 @@ void MP3Stream::initStream() {
// Reset the stream data
_inStream->seek(0, SEEK_SET);
- _totalTime = mad_timer_zero;
+ _curTime = mad_timer_zero;
_posInFrame = 0;
// Update state
@@ -282,7 +282,7 @@ void MP3Stream::readHeader() {
}
// Sum up the total playback time so far
- mad_timer_add(&_totalTime, _frame.header.duration);
+ mad_timer_add(&_curTime, _frame.header.duration);
break;
}
Commit: 3dc9b75dfcc9cde14bb56231ab222615f64121f2
https://github.com/scummvm/scummvm/commit/3dc9b75dfcc9cde14bb56231ab222615f64121f2
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2014-08-04T15:38:02+02:00
Commit Message:
Merge pull request #485 from Akz-/mp3-seeking-fix
AUDIO: Increment total play time when decoding MP3 data.
Changed paths:
audio/decoders/mp3.cpp
More information about the Scummvm-git-logs
mailing list