diff options
author | Alex Chronopoulos <[email protected]> | 2016-03-04 18:12:28 +0200 |
---|---|---|
committer | Alex Chronopoulos <[email protected]> | 2016-03-09 13:27:14 +0200 |
commit | 5175d9786bb0adceeea69fcaca34c424cb97264c (patch) | |
tree | 1a428b4b014bf40603033f1840637570f39c4fec /src/cubeb_resampler_internal.h | |
parent | ac4332e18fc0cef7c4be02a19de9cf4dad435acc (diff) | |
download | cubeb-5175d9786bb0adceeea69fcaca34c424cb97264c.tar.gz cubeb-5175d9786bb0adceeea69fcaca34c424cb97264c.zip |
Fix link error on test_resampler build.
Diffstat (limited to 'src/cubeb_resampler_internal.h')
-rw-r--r-- | src/cubeb_resampler_internal.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/cubeb_resampler_internal.h b/src/cubeb_resampler_internal.h index c845d91..eed16c4 100644 --- a/src/cubeb_resampler_internal.h +++ b/src/cubeb_resampler_internal.h @@ -1,5 +1,5 @@ /* - * Copyright � 2016 Mozilla Foundation + * Copyright © 2016 Mozilla Foundation * * This program is made available under an ISC-style license. See the * accompanying file LICENSE for details. @@ -32,9 +32,6 @@ namespace std int to_speex_quality(cubeb_resampler_quality q); -template<typename T> -class cubeb_resampler_speex_one_way; - struct cubeb_resampler { virtual long fill(void * input_buffer, long * input_frames_count, void * output_buffer, long frames_needed) = 0; @@ -155,10 +152,22 @@ public: cubeb_resampler_speex_one_way(uint32_t channels, uint32_t source_rate, uint32_t target_rate, - int quality); + int quality) + : processor(channels) + , resampling_ratio(static_cast<float>(source_rate) / target_rate) + , additional_latency(0) + { + int r; + speex_resampler = speex_resampler_init(channels, source_rate, + target_rate, quality, &r); + assert(r == RESAMPLER_ERR_SUCCESS && "resampler allocation failure"); + } /** Destructor, deallocate the resampler */ - virtual ~cubeb_resampler_speex_one_way(); + virtual ~cubeb_resampler_speex_one_way() + { + speex_resampler_destroy(speex_resampler); + } /** Sometimes, it is necessary to add latency on one way of a two-way * resampler so that the stream are synchronized. This must be called only on |