title: Crash related to MediaCodec.cpp: CHECK_EQ( mState,CONFIGURING)
body: <p>Could anyone shed some light on the following crash report?  Is there a way to prevent such crashes?</p>
  
  <pre><code>Build fingerprint: 'samsung/kltexx/klte:5.0/LRX21T/G900FXXU1BNL9:user/release-keys'
  Revision: '14'
  ABI: 'arm'
  pid: 13847, tid: 16899, name: MediaCodec_loop &gt;&gt;&gt; net.mydomain.myapp &lt;&lt;&lt;
  signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
  Abort message: 'frameworks/av/media/libstagefright/MediaCodec.cpp:967 CHECK_EQ( mState,CONFIGURING) failed: 9 vs. 3'
  r0 00000000 r1 00004203 r2 00000006 r3 00000000
  r4 9b2ffdb8 r5 00000006 r6 00000000 r7 0000010c
  r8 00000000 r9 b55fa024 sl 9b2ffc74 fp 9b2ffc80
  ip 00004203 sp 9b2ff7e0 lr b6f2ffd5 pc b6f53978 cpsr 600d0010
  
  backtrace:
  #00 pc 00037978 /system/lib/libc.so (tgkill+12)
  #01 pc 00013fd1 /system/lib/libc.so (pthread_kill+52)
  #02 pc 00014bef /system/lib/libc.so (raise+10)
  #03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
  #04 pc 0000fcbc /system/lib/libc.so (abort+4)
  #05 pc 00007af1 /system/lib/libcutils.so (__android_log_assert+88)
  #06 pc 00098c8b /system/lib/libstagefright.so (android::MediaCodec::onMessageReceived(android::sp&lt;android::AMessage&gt; const&amp;)+486)
  #07 pc 0000a5a3 /system/lib/libstagefright_foundation.so (android::ALooperRoster::deliverMessage(android::sp&lt;android::AMessage&gt; const&amp;)+166)
  #08 pc 00009f25 /system/lib/libstagefright_foundation.so (android::ALooper::loop()+220)
  #09 pc 0000ef11 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
  #10 pc 000603bd /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+72)
  #11 pc 0000ea81 /system/lib/libutils.so
  #12 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
  #13 pc 0001189b /system/lib/libc.so (__start_thread+6)
  </code></pre>