MediaCodec: move to UNINITIALIZED state on codec error

ACodec moves to Uninitialized state after receiving codec error.
Make MediaCodec also move to the same state, so stop() and
release() will work correctly.

Bug: 13675112
Change-Id: I1c7e8b274f68345fc0e6a55c70dff6c7a4fb2e72
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index e0419ca..601dccf 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -603,6 +603,7 @@
                             postActivityNotificationIfPossible();
 
                             cancelPendingDequeueOperations();
+                            setState(UNINITIALIZED);
                             break;
                         }
 
@@ -612,6 +613,7 @@
 
                             mFlags |= kFlagStickyError;
                             postActivityNotificationIfPossible();
+                            setState(UNINITIALIZED);
                             break;
                         }
                     }