From 8b2a453ab6698eae4560389c6e8f6ecab2643218 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 24 Feb 2012 13:58:09 -0800 Subject: Make sure we return input/output buffers to the codec not just while flushing but also while stopping. Change-Id: I23534008b93654c9b9c022c0b1d204c2b546d566 --- media/libstagefright/MediaCodec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/MediaCodec.cpp') diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 4acbdbe..d22cab9 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -577,7 +577,7 @@ void MediaCodec::onMessageReceived(const sp &msg) { { /* size_t index = */updateBuffers(kPortIndexInput, msg); - if (mState == FLUSHING) { + if (mState == FLUSHING || mState == STOPPING) { returnBuffersToCodecOnPort(kPortIndexInput); break; } @@ -596,7 +596,7 @@ void MediaCodec::onMessageReceived(const sp &msg) { { /* size_t index = */updateBuffers(kPortIndexOutput, msg); - if (mState == FLUSHING) { + if (mState == FLUSHING || mState == STOPPING) { returnBuffersToCodecOnPort(kPortIndexOutput); break; } -- cgit v1.1