Set the stream delay to zero if too low.

- Return a stream warning instead of an error.
- Add a few delay offset tests.

BUG=
TEST=audioproc_unittest

Review URL: https://webrtc-codereview.appspot.com/607004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2316 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/modules/audio_processing/audio_processing_impl.cc b/src/modules/audio_processing/audio_processing_impl.cc
index 27a5ada..74363ee 100644
--- a/src/modules/audio_processing/audio_processing_impl.cc
+++ b/src/modules/audio_processing/audio_processing_impl.cc
@@ -450,21 +450,23 @@
 }
 
 int AudioProcessingImpl::set_stream_delay_ms(int delay) {
+  Error retval = kNoError;
   was_stream_delay_set_ = true;
   delay += delay_offset_ms_;
 
   if (delay < 0) {
-    return kBadParameterError;
+    delay = 0;
+    retval = kBadStreamParameterWarning;
   }
 
   // TODO(ajm): the max is rather arbitrarily chosen; investigate.
   if (delay > 500) {
-    stream_delay_ms_ = 500;
-    return kBadStreamParameterWarning;
+    delay = 500;
+    retval = kBadStreamParameterWarning;
   }
 
   stream_delay_ms_ = delay;
-  return kNoError;
+  return retval;
 }
 
 int AudioProcessingImpl::stream_delay_ms() const {