OSDN Git Service

Make sure resume() and flush() are handled appropriately even if the codec
authorMarco Nelissen <marcone@google.com>
Thu, 4 Apr 2013 22:37:21 +0000 (15:37 -0700)
committerMarco Nelissen <marcone@google.com>
Thu, 4 Apr 2013 22:37:21 +0000 (15:37 -0700)
is in Loaded->Idle state.
b/8347958

Change-Id: Ic14d29502a7effc636251379bb1bbc25739db98e

media/libstagefright/ACodec.cpp

index c9f8741..ff72b71 100644 (file)
@@ -3416,6 +3416,21 @@ bool ACodec::LoadedToIdleState::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;
+        }
+
         default:
             return BaseState::onMessageReceived(msg);
     }