From 5cb957d7fbb504b8ae4959f21d4938e757f5e933 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Thu, 21 Jan 2016 11:51:36 -0500 Subject: [PATCH] Bug 1221587: temporary Win32 build fixes for cubeb full-duplex patch rs=padenot To be backed out/overwritten on next merge from upstream libcubeb --HG-- extra : commitid : CQtyLPoncz2 --- media/libcubeb/src/cubeb_resampler.cpp | 17 +++++++++-------- media/libcubeb/src/cubeb_resampler.h | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/media/libcubeb/src/cubeb_resampler.cpp b/media/libcubeb/src/cubeb_resampler.cpp index 21922e5b19c3..44ad601cedea 100644 --- a/media/libcubeb/src/cubeb_resampler.cpp +++ b/media/libcubeb/src/cubeb_resampler.cpp @@ -69,7 +69,7 @@ to_speex_quality(cubeb_resampler_quality q) } // end of anonymous namespace struct cubeb_resampler { - virtual long fill(void * buffer, long frames_needed) = 0; + virtual long fill(void * input_buffer, void * buffer, long frames_needed) = 0; virtual ~cubeb_resampler() {} }; @@ -84,9 +84,9 @@ public: { } - virtual long fill(void * buffer, long frames_needed) + virtual long fill(void * input_buffer, void * buffer, long frames_needed) { - long got = data_callback(stream, user_ptr, buffer, frames_needed); + long got = data_callback(stream, user_ptr, input_buffer, buffer, frames_needed); assert(got <= frames_needed); return got; } @@ -106,7 +106,7 @@ public: virtual ~cubeb_resampler_speex(); - virtual long fill(void * buffer, long frames_needed); + virtual long fill(void * input_buffer, void * buffer, long frames_needed); private: SpeexResamplerState * const speex_resampler; @@ -161,7 +161,7 @@ cubeb_resampler_speex::~cubeb_resampler_speex() } long -cubeb_resampler_speex::fill(void * buffer, long frames_needed) +cubeb_resampler_speex::fill(void * input_buffer, void * buffer, long frames_needed) { // Use more input frames than strictly necessary, so in the worst case, // we have leftover unresampled frames at the end, that we can use @@ -175,7 +175,7 @@ cubeb_resampler_speex::fill(void * buffer, long frames_needed) memcpy(resampling_src_buffer.get(), leftover_frames_buffer.get(), leftover_bytes); uint8_t * buffer_start = resampling_src_buffer.get() + leftover_bytes; - long got = data_callback(stream, user_ptr, buffer_start, frames_requested); + long got = data_callback(stream, user_ptr, input_buffer, buffer_start, frames_requested); assert(got <= frames_requested); if (got < 0) { @@ -239,9 +239,10 @@ cubeb_resampler_create(cubeb_stream * stream, long cubeb_resampler_fill(cubeb_resampler * resampler, - void * buffer, long frames_needed) + void * input_buffer, void * buffer, + long frames_needed) { - return resampler->fill(buffer, frames_needed); + return resampler->fill(input_buffer, buffer, frames_needed); } void diff --git a/media/libcubeb/src/cubeb_resampler.h b/media/libcubeb/src/cubeb_resampler.h index e63c2c18aa07..12a16a770810 100644 --- a/media/libcubeb/src/cubeb_resampler.h +++ b/media/libcubeb/src/cubeb_resampler.h @@ -53,7 +53,8 @@ cubeb_resampler * cubeb_resampler_create(cubeb_stream * stream, * @retval CUBEB_ERROR on error. */ long cubeb_resampler_fill(cubeb_resampler * resampler, - void * buffer, long frames_needed); + void * input_buffer, void * buffer, + long frames_needed); /** * Destroy a cubeb_resampler.