summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-02-24 13:58:09 -0800
committerAndreas Huber <andih@google.com>2012-02-24 13:58:09 -0800
commit8b2a453ab6698eae4560389c6e8f6ecab2643218 (patch)
treefbd8a79f356bf786b74324192b3c401942c5477e /media/libstagefright/MediaCodec.cpp
parent54263bcfa6e9ad2fcb3e89617240f4ec0b3a2f99 (diff)
downloadframeworks_av-8b2a453ab6698eae4560389c6e8f6ecab2643218.zip
frameworks_av-8b2a453ab6698eae4560389c6e8f6ecab2643218.tar.gz
frameworks_av-8b2a453ab6698eae4560389c6e8f6ecab2643218.tar.bz2
Make sure we return input/output buffers to the codec not just while
flushing but also while stopping. Change-Id: I23534008b93654c9b9c022c0b1d204c2b546d566
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp4
1 files changed, 2 insertions, 2 deletions
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<AMessage> &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<AMessage> &msg) {
{
/* size_t index = */updateBuffers(kPortIndexOutput, msg);
- if (mState == FLUSHING) {
+ if (mState == FLUSHING || mState == STOPPING) {
returnBuffersToCodecOnPort(kPortIndexOutput);
break;
}