diff options
author | Jean-Yves Avenard <[email protected]> | 2018-09-12 16:46:01 +0200 |
---|---|---|
committer | Jean-Yves Avenard <[email protected]> | 2018-09-12 16:46:01 +0200 |
commit | 1b4547f695f88e877e199763a0f84da85349e742 (patch) | |
tree | de9cff236a3d7aef45da47f2d4fd7597cbea6b5c /src/cubeb_audiounit.cpp | |
parent | c3b504510f278fd4a579fe044ccf9fbdabcb4c78 (diff) | |
download | cubeb-1b4547f695f88e877e199763a0f84da85349e742.tar.gz cubeb-1b4547f695f88e877e199763a0f84da85349e742.zip |
Properly reset the number of frames present in the input buffer after re-creating it
Otherwise we would be out of sync triggering the assert. This resolves the issue mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1489052#c10
Diffstat (limited to 'src/cubeb_audiounit.cpp')
-rw-r--r-- | src/cubeb_audiounit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cubeb_audiounit.cpp b/src/cubeb_audiounit.cpp index e020e5c..3ee36d4 100644 --- a/src/cubeb_audiounit.cpp +++ b/src/cubeb_audiounit.cpp @@ -518,6 +518,7 @@ audiounit_input_callback(void * user_ptr, // Reset input buffer stm->input_linear_buffer->clear(); + stm->available_input_frames = 0; return noErr; } @@ -2056,6 +2057,7 @@ audiounit_init_input_linear_buffer(cubeb_stream * stream, uint32_t capacity) stream->input_linear_buffer.reset(new auto_array_wrapper_impl<float>(size)); } assert(stream->input_linear_buffer->length() == 0); + stream->available_input_frames = 0; return CUBEB_OK; } |