commit | 9da7c7480ba15080f14e91c955351e6b037507f4 | [log] [tgz] |
---|---|---|
author | Sam Zackrisson <saza@webrtc.org> | Mon Oct 30 09:05:10 2017 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Oct 30 10:03:19 2017 |
tree | ae88cd420663d40478817f92b7d682d62277e2f7 | |
parent | 90397d9aa9f892df1cd67cbe00ffa6b39a5f5e48 [diff] |
Change Resampler to not change state on invalid Reset and ResetIfNeeded calls. Adds a unittest to test this. A Reset() with unsupported frequencies will fail, but currently leaves the resampler in an illegal state. Subsequent calls to ResetIfNeeded(), which depends on the internal state, will then have unreliable behavior. The following sequence of calls demonstrate this: It appears as though the resampler is successfully reinitialized to upsample from 44 kHz to 48 kHz, but will in fact crash on Push(). Resampler::Reset() with in=44000, out=32000 // Returns 0 Resampler::ResetIfNeeded() with in=44000, out=48000 // Returns -1 Resampler::ResetIfNeeded() with in=44000, out=48000 // Returns 0 Resampler::Push() with some data Bug: webrtc:8426 Change-Id: Id1e0528ffcb7a86702d4c2f4c5103a1db419c07d Reviewed-on: https://webrtc-review.googlesource.com/16424 Commit-Queue: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20474}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.