aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_resampler_internal.h
diff options
context:
space:
mode:
authorAlex Chronopoulos <[email protected]>2017-02-15 15:02:07 +0200
committerPaul Adenot <[email protected]>2017-02-15 14:02:07 +0100
commit581d4bc8b16e5f81fe299e2ab9897ec48da8610a (patch)
tree0099e2898692f99332e594c05ae387ce78e05ba3 /src/cubeb_resampler_internal.h
parent167bc2246aa5159af4712e69628e56e5cc90fdfe (diff)
downloadcubeb-581d4bc8b16e5f81fe299e2ab9897ec48da8610a.tar.gz
cubeb-581d4bc8b16e5f81fe299e2ab9897ec48da8610a.zip
Audiounit drift with c920 webcam (Bug 1329190) (#221)
* resampler: return unsed frames in all cases * audiounit: Stop pushing silence if there are remaining frames audiounit: Push linence based only on input length * audiounit: Create async verbose log macro ALOGV * audiounit: Create async normal log macro ALOG * audiounit: Deregister alive listener (Bug 1321714) * audiounit: Return listener on unexpected event * audiounit: Initialize shutdown to true * audiounit, resampler: apply review commnets
Diffstat (limited to 'src/cubeb_resampler_internal.h')
-rw-r--r--src/cubeb_resampler_internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cubeb_resampler_internal.h b/src/cubeb_resampler_internal.h
index 9c17a51..bb5da05 100644
--- a/src/cubeb_resampler_internal.h
+++ b/src/cubeb_resampler_internal.h
@@ -222,7 +222,7 @@ public:
/** Returns a buffer containing exactly `output_frame_count` resampled frames.
* The consumer should not hold onto the pointer. */
- T * output(size_t output_frame_count)
+ T * output(size_t output_frame_count, size_t * input_frames_used)
{
if (resampling_out_buffer.capacity() < frames_to_samples(output_frame_count)) {
resampling_out_buffer.reserve(frames_to_samples(output_frame_count));
@@ -239,6 +239,7 @@ public:
/* This shifts back any unresampled samples to the beginning of the input
buffer. */
resampling_in_buffer.pop(nullptr, frames_to_samples(in_len));
+ *input_frames_used = in_len;
return resampling_out_buffer.data();
}
@@ -376,7 +377,7 @@ public:
* @parameter frames_needed the number of frames to be returned.
* @return a buffer containing the delayed frames. The consumer should not
* hold onto the pointer. */
- T * output(uint32_t frames_needed)
+ T * output(uint32_t frames_needed, size_t * input_frames_used)
{
if (delay_output_buffer.capacity() < frames_to_samples(frames_needed)) {
delay_output_buffer.reserve(frames_to_samples(frames_needed));
@@ -386,6 +387,7 @@ public:
delay_output_buffer.push(delay_input_buffer.data(),
frames_to_samples(frames_needed));
delay_input_buffer.pop(nullptr, frames_to_samples(frames_needed));
+ *input_frames_used = frames_needed;
return delay_output_buffer.data();
}