diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-18 09:39:36 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-18 09:39:36 +0000 |
| commit | 9c399a21b37d83ceb2c81706975e2c46d1a3f673 (patch) | |
| tree | 5b1123cd22cad797c9587c22927f9c9249ed4ca4 /src/lib/resampler.cc | |
| parent | da19eaac0dd80afed3dd282d61ea3298196a5090 (diff) | |
Considerable rework of decoder timing; tests pass, at least.
Diffstat (limited to 'src/lib/resampler.cc')
| -rw-r--r-- | src/lib/resampler.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/resampler.cc b/src/lib/resampler.cc index d897bf562..00121384d 100644 --- a/src/lib/resampler.cc +++ b/src/lib/resampler.cc @@ -64,11 +64,9 @@ Resampler::~Resampler () swr_free (&_swr_context); } -pair<shared_ptr<const AudioBuffers>, AudioContent::Frame> -Resampler::run (shared_ptr<const AudioBuffers> in, AudioContent::Frame frame) +shared_ptr<const AudioBuffers> +Resampler::run (shared_ptr<const AudioBuffers> in) { - AudioContent::Frame const resamp_time = swr_next_pts (_swr_context, frame * _out_rate) / _in_rate; - /* Compute the resampled frames count and add 32 for luck */ int const max_resampled_frames = ceil ((double) in->frames() * _out_rate / _in_rate) + 32; shared_ptr<AudioBuffers> resampled (new AudioBuffers (_channels, max_resampled_frames)); @@ -84,7 +82,7 @@ Resampler::run (shared_ptr<const AudioBuffers> in, AudioContent::Frame frame) } resampled->set_frames (resampled_frames); - return make_pair (resampled, resamp_time); + return resampled; } shared_ptr<const AudioBuffers> |
