title: MediaCodec decoder strange behaviour
body: <p>In my implementation I use for MediaCodec decoders to decode videos in a sequential order frame by frame and everything works fine. But if before starting the decoding process I play some media using MediaPlayer and TextureView (extended TextureView that I render on with GLES), the forth decoder won't act normal for example when the outputFormat changes it returns a wrong color-format for the codec while the first three decoders work normally.
  I know it's mostly hardware dependant but any thought would be appreciated specifically on the relationship it has with MediaPlayer.</p>
  
  <p>p.s: I do release and clean up the MediaPlayer instance before starting decoding. </p>
  
  <p>EDIT:</p>
  
  <p>The device is Samsung Note3 and I'm playing back regular media. When it fails the behaviour stays even if I wait couple of minutes or if I force stop the activity and rerun it unless I restart the device. The expected color-format as you can see in following logs is "QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m". </p>
  
  <p>Before failure:</p>
  
  <pre><code>...MediaEditor( 6837): [503] decoder0 output format changed: {height=720,   what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [503] decoder1 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [503] decoder2 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [503] decoder3 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  </code></pre>
  
  <p>After failure: </p>
  
  <pre><code>...MediaEditor( 6837): [503] decoder0 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [503] decoder1 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [503] decoder2 output format changed: {height=720, what=1869968451, color-format=2141391876, slice-height=736, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [512] surface decoder0 given buffer 0 (size=1413120)
  ...MediaEditor( 6837): [512] surface decoder1 given buffer 0 (size=1413120)
  ...MediaEditor( 6837): [512] surface decoder2 given buffer 0 (size=1413120)
  ...MediaEditor( 6837): [503] decoder3 output format changed: {height=720, what=1869968451, color-format=19, slice-height=720, crop-left=0, width=1280, crop-bottom=719, crop-top=0, mime=video/raw, stride=1280, crop-right=1279}
  ...MediaEditor( 6837): [512] surface decoder0 given buffer 1 (size=1413120)
  ...MediaEditor( 6837): [512] surface decoder1 given buffer 1 (size=1413120)
  ...MediaEditor( 6837): [512] surface decoder2 given buffer 1 (size=1413120)
  ...MediaEditor( 6837): [512] surface decoder3 given buffer 0 (size=1382400)
  </code></pre>