diff options
author | Johannes Schickel | 2010-01-06 20:25:19 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-06 20:25:19 +0000 |
commit | b6fb8b349a3260e8e3377366ccda45fc3b8c869e (patch) | |
tree | facadec9b892fa8d406c122fe9f124ed1c334837 /sound/flac.cpp | |
parent | b6b8a23cee82a7011b4007fa1506d42e64e0c284 (diff) | |
download | scummvm-rg350-b6fb8b349a3260e8e3377366ccda45fc3b8c869e.tar.gz scummvm-rg350-b6fb8b349a3260e8e3377366ccda45fc3b8c869e.tar.bz2 scummvm-rg350-b6fb8b349a3260e8e3377366ccda45fc3b8c869e.zip |
Fix FLAC's getLength implementation.
svn-id: r47093
Diffstat (limited to 'sound/flac.cpp')
-rw-r--r-- | sound/flac.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/flac.cpp b/sound/flac.cpp index b592468baf..d907137e8c 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -95,7 +95,7 @@ protected: /** index of the first sample to be played */ FLAC__uint64 _firstSample; - /** index + 1(!) of the last sample to be played - 0 is end of stream */ + /** index + 1(!) of the last sample to be played */ FLAC__uint64 _lastSample; /** total play time */ @@ -247,7 +247,7 @@ FlacInputStream::FlacInputStream(Common::SeekableReadStream *inStream, bool disp // Compute the start/end sample (we use floating point arithmetics here to // avoid overflows). _firstSample = (FLAC__uint64)(startTime * (_streaminfo.sample_rate / 1000.0)); - _lastSample = (FLAC__uint64)(endTime * (_streaminfo.sample_rate / 1000.0)); + _lastSample = !endTime ? _streaminfo.total_samples + 1 : (FLAC__uint64)(endTime * (_streaminfo.sample_rate / 1000.0)); if (_firstSample == 0 || seekAbsolute(_firstSample)) { int32 samples = -1; |