OSDN Git Service

Make sure resume() and flush() are handled appropriately even if the codec
authorAndreas Huber <andih@google.com>
Thu, 28 Mar 2013 18:16:43 +0000 (11:16 -0700)
committerAndreas Huber <andih@google.com>
Thu, 28 Mar 2013 18:16:43 +0000 (11:16 -0700)
is in Idle->Executing state.

Change-Id: I16a10791fae0e062a19299732c472cc93e4ed971
related-to-bug: 8347958

media/libstagefright/ACodec.cpp

index 1a2eeb1..c9f8741 100644 (file)
@@ -3461,6 +3461,22 @@ bool ACodec::IdleToExecutingState::onMessageReceived(const sp<AMessage> &msg) {
             return true;
         }
 
+        case kWhatResume:
+        {
+            // We'll be active soon enough.
+            return true;
+        }
+
+        case kWhatFlush:
+        {
+            // We haven't even started yet, so we're flushed alright...
+            sp<AMessage> notify = mCodec->mNotify->dup();
+            notify->setInt32("what", ACodec::kWhatFlushCompleted);
+            notify->post();
+
+            return true;
+        }
+
         case kWhatSignalEndOfInputStream:
         {
             mCodec->onSignalEndOfInputStream();