diff options
author | Lajos Molnar <lajos@google.com> | 2014-09-10 13:53:21 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-09-10 13:54:02 -0700 |
commit | b9b87fe9d9f3d91c05300a22920d7227a3f8eb83 (patch) | |
tree | 5014fdcafbd61ed00b1872505e928dfe89b797af | |
parent | e4c8b32f1123aa639f46d234203ad5c5e7926628 (diff) | |
download | frameworks_av-b9b87fe9d9f3d91c05300a22920d7227a3f8eb83.zip frameworks_av-b9b87fe9d9f3d91c05300a22920d7227a3f8eb83.tar.gz frameworks_av-b9b87fe9d9f3d91c05300a22920d7227a3f8eb83.tar.bz2 |
mediaplayer: release MediaBuffer in stale input buffers
Bug: 17454455
Change-Id: If63a6e42f96851d6c10fdec11360f0dabae9bf50
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp index 8ce7baf..163a0b5 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp @@ -595,7 +595,18 @@ void NuPlayer::Decoder::onMessageReceived(const sp<AMessage> &msg) { { if (!isStaleReply(msg)) { onInputBufferFilled(msg); + } else { + /* release any MediaBuffer passed in the stale buffer */ + sp<ABuffer> buffer; + MediaBuffer *mediaBuffer = NULL; + if (msg->findBuffer("buffer", &buffer) && + buffer->meta()->findPointer( + "mediaBuffer", (void **)&mediaBuffer) && + mediaBuffer != NULL) { + mediaBuffer->release(); + } } + break; } |