webrtc/common_audio/resampler
Sam Zackrisson 9da7c7480b 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}
2017-10-30 10:03:19 +00:00
..
include Change Resampler to not change state on invalid Reset and ResetIfNeeded calls. 2017-10-30 10:03:19 +00:00
push_resampler.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
push_resampler_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
push_sinc_resampler.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
push_sinc_resampler.h Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
push_sinc_resampler_unittest.cc Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
resampler.cc Change Resampler to not change state on invalid Reset and ResetIfNeeded calls. 2017-10-30 10:03:19 +00:00
resampler_unittest.cc Change Resampler to not change state on invalid Reset and ResetIfNeeded calls. 2017-10-30 10:03:19 +00:00
sinc_resampler.cc Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
sinc_resampler.h Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
sinc_resampler_neon.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
sinc_resampler_sse.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
sinc_resampler_unittest.cc Stop using std::tr1 2017-10-23 22:11:58 +00:00
sinusoidal_linear_chirp_source.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
sinusoidal_linear_chirp_source.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00