Make sure to finish the preparation phase even EOS occurs before we consider the cache to be completely filled up.

Change-Id: I29143e357fb6ea7b860636100e010f2ea7436798
related-to-bug: 3037389
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 3975866..040e27d 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -484,6 +484,10 @@
 
         if (eos) {
             notifyListener_l(MEDIA_BUFFERING_UPDATE, 100);
+            if (mFlags & PREPARING) {
+                LOGV("cache has reached EOS, prepare is done.");
+                finishAsyncPrepare_l();
+            }
         } else {
             off_t size;
             if (mDurationUs >= 0 && mCachedSource->getSize(&size) == OK) {