summaryrefslogtreecommitdiff
path: root/src/lib/sndfile_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-15 22:00:15 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-15 22:00:15 +0100
commit6d21165ff96f354933ee32ce2ce31ee5ecc48598 (patch)
tree6d4435a60e259964d398a604f3f0e03dc24ff9f9 /src/lib/sndfile_decoder.cc
parent76abad0130469d45253286486eae7361e45671a4 (diff)
parentf166fa19db164653e8229133a18f2e53dd722333 (diff)
Merge branch 'fix-early-audio-take2' into staging
Diffstat (limited to 'src/lib/sndfile_decoder.cc')
-rw-r--r--src/lib/sndfile_decoder.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/sndfile_decoder.cc b/src/lib/sndfile_decoder.cc
index 0e3e5e234..af59c049c 100644
--- a/src/lib/sndfile_decoder.cc
+++ b/src/lib/sndfile_decoder.cc
@@ -113,8 +113,8 @@ SndfileDecoder::pass ()
to what FFmpeg (and in particular the resampler) can cope with.
*/
sf_count_t const block = _audio_stream->sample_rate() / 2;
-
shared_ptr<AudioBuffers> audio (new AudioBuffers (_audio_stream->channels(), block));
+ sf_count_t done = 0;
while (frames > 0) {
sf_count_t const this_time = min (block, frames);
for (size_t i = 0; i < sndfiles.size(); ++i) {
@@ -126,7 +126,8 @@ SndfileDecoder::pass ()
}
audio->set_frames (this_time);
- Audio (audio);
+ Audio (audio, double(done) / _audio_stream->sample_rate());
+ done += this_time;
frames -= this_time;
}