title: MediaCodec decoding to buffer does not work while decoding to surface works
body: <p>The video decoding code of an app is typical, just like the example code in the <a href="http://developer.android.com/reference/android/media/MediaCodec.html#queueInputBuffer(int,%20int,%20int,%20long,%20int)" rel="nofollow noreferrer">MediaCodec document</a>. Nothing special. The configuration statement is like the following:</p>
  <pre><code>myMediaCodec.configure(myMediaFormat, mySurface, null, 0);
  </code></pre>
  <p>Everything works fine.  However, if I change the above code to the following to decode the video to a buffer instead of a surface:</p>
  <pre><code>myMediaCodec.configure(myMediaFormat, null, null, 0);
  </code></pre>
  <p>then the following code:</p>
  <pre><code>int iOutputBufferIndex = myMediaCodec.dequeueOutputBuffer(myBufferInfo, 100000);
  </code></pre>
  <p>will always return MediaCodec.INFO_TRY_AGAIN_LATER. Even more strangly, any subsequent call of myMediaCodec.stop() or myMediaCodec.release() will hang (i.e. the call never returns or generates an exception).
  This happens on a generic (AGPTek) tablet (Allwinner A31S, 1.5GHz Cortex A7 Quad Core).  On a simulator and another tablet (Asus Memo Pad), everything works fine.</p>
  <p>I am asking for any tip to help get around this problem.</p>