Small fixes to run ACM2 tests.

BUG=
R=minyue@google.com

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4836 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/modules/audio_coding/main/acm2/acm_codec_database.cc b/modules/audio_coding/main/acm2/acm_codec_database.cc
index f99c85b..225098a 100644
--- a/modules/audio_coding/main/acm2/acm_codec_database.cc
+++ b/modules/audio_coding/main/acm2/acm_codec_database.cc
@@ -270,7 +270,7 @@
     // Opus supports frames shorter than 10ms,
     // but it doesn't help us to use them.
     // Mono and stereo.
-    {1, {960}, 0, 2, false},
+    {4, {480, 960, 1920, 2880}, 0, 2, false},
 #endif
 #ifdef WEBRTC_CODEC_SPEEX
     {3, {160, 320, 480}, 0, 1, false},
diff --git a/modules/audio_coding/main/acm2/acm_receiver.cc b/modules/audio_coding/main/acm2/acm_receiver.cc
index 949a705..d5acfac 100644
--- a/modules/audio_coding/main/acm2/acm_receiver.cc
+++ b/modules/audio_coding/main/acm2/acm_receiver.cc
@@ -545,6 +545,8 @@
       }
     }
   }
+  // No codec is registered, invalidate last audio decoder.
+  last_audio_decoder_ = -1;
   return ret_val;
 }
 
@@ -561,6 +563,8 @@
   }
   CriticalSectionScoped lock(neteq_crit_sect_);
   decoders_[codec_index].registered = false;
+  if (last_audio_decoder_ == codec_index)
+    last_audio_decoder_ = -1;  // Codec is removed, invalidate last decoder.
   return 0;
 }
 
diff --git a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index 3a7d271..3c704c2 100644
--- a/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -1536,8 +1536,7 @@
 // removing and registering a decoder we can achieve the effect of resetting.
 // Reset the decoder state.
 int AudioCodingModuleImpl::ResetDecoder() {
-  CriticalSectionScoped lock(acm_crit_sect_);
-  return -1;
+  return 0;
 }
 
 // Get current receive frequency.