diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-13 20:44:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-13 20:44:45 +0100 |
| commit | 3ddd928233130695d7f4eeee47a71409d8c04de7 (patch) | |
| tree | 9f616a27fc6492b30536a2a366cf9e7211a87a3d /src/lib/audio_decoder.cc | |
| parent | e8c5f14cb6736bdfa3610b2559c6c331c1c56984 (diff) | |
Very basic audio processing framework.
Diffstat (limited to 'src/lib/audio_decoder.cc')
| -rw-r--r-- | src/lib/audio_decoder.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 97a088791..19f31d30a 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -24,6 +24,7 @@ #include "resampler.h" #include "util.h" #include "film.h" +#include "audio_processor.h" #include "i18n.h" @@ -43,13 +44,17 @@ AudioDecoder::AudioDecoder (shared_ptr<const AudioContent> content) _resampler.reset (new Resampler (content->audio_frame_rate(), content->resampled_audio_frame_rate(), content->audio_channels ())); } + if (content->audio_processor ()) { + _processor = content->audio_processor()->clone (); + } + reset_decoded_audio (); } void AudioDecoder::reset_decoded_audio () { - _decoded_audio = ContentAudio (shared_ptr<AudioBuffers> (new AudioBuffers (_audio_content->audio_channels(), 0)), 0); + _decoded_audio = ContentAudio (shared_ptr<AudioBuffers> (new AudioBuffers (_audio_content->processed_audio_channels(), 0)), 0); } shared_ptr<ContentAudio> @@ -125,6 +130,10 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time) data = _resampler->run (data); } + if (_processor) { + data = _processor->run (data); + } + AudioFrame const frame_rate = _audio_content->resampled_audio_frame_rate (); if (_seek_reference) { |
