ACodec: blank surface when switching to another surface

Bug: 20885565
Change-Id: I9b0d279724aab24e0a270770258716d115ef15bc
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 134bdae..5475a4a 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -651,6 +651,11 @@
         (void)surface->getIGraphicBufferProducer()->allowAllocation(false);
     }
 
+    // push blank buffers to previous window if requested
+    if (mFlags & kFlagPushBlankBuffersToNativeWindowOnShutdown) {
+        pushBlankBuffersToNativeWindow(mNativeWindow.get());
+    }
+
     mNativeWindow = nativeWindow;
     return OK;
 }