diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-05 23:10:16 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-05 23:10:16 +0000 |
| commit | 18614dda0d53b713ace5ad1df57298d049dba87f (patch) | |
| tree | e68887db77ec57a2de344f8230b0e801030bdca5 /src/lib/external_audio_decoder.cc | |
| parent | 8fa7b8c13a76bd54207156de7bb0d09316bad379 (diff) | |
Split timed from untimed sinks / sources. Should produce same output, in theory.
Diffstat (limited to 'src/lib/external_audio_decoder.cc')
| -rw-r--r-- | src/lib/external_audio_decoder.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/external_audio_decoder.cc b/src/lib/external_audio_decoder.cc index 1248b5a3b..50e5852c5 100644 --- a/src/lib/external_audio_decoder.cc +++ b/src/lib/external_audio_decoder.cc @@ -115,6 +115,7 @@ ExternalAudioDecoder::pass () 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 +127,8 @@ ExternalAudioDecoder::pass () } audio->set_frames (this_time); - Audio (audio); + Audio (audio, double(done) / _audio_stream->sample_rate()); + done += this_time; frames -= this_time; } |
