diff options
author | Lajos Molnar <lajos@google.com> | 2013-04-26 16:11:45 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2013-05-31 20:05:22 +0000 |
commit | e532d37cf9342abbca398e4ce671b880369d90c6 (patch) | |
tree | 0813324bffd8d4a8a36bf1d0d348777533801ac3 /media | |
parent | 41688da226e91c97ea3b2fe096044e1e5b0520bc (diff) | |
download | frameworks_av-e532d37cf9342abbca398e4ce671b880369d90c6.zip frameworks_av-e532d37cf9342abbca398e4ce671b880369d90c6.tar.gz frameworks_av-e532d37cf9342abbca398e4ce671b880369d90c6.tar.bz2 |
stagefright: Fix port-reconfiguration & output-buffer-filled race condition
Remove the invalid assumption that when a port-reconfiguration event
is received, buffers cannot be downstream (waiting to be rendered).
Luckily, these buffers are properly handled (freed) after they are
sent to be rendered.
Change-Id: I1df39c1ffc2bfb96f8b7b4ee5be07cae654f956f
Signed-off-by: Lajos Molnar <lajos@google.com>
Bug: 8736466
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 994d3f4..64e3885 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -748,12 +748,10 @@ status_t ACodec::freeOutputBuffersNotOwnedByComponent() { BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); - if (info->mStatus != - BufferInfo::OWNED_BY_COMPONENT) { - // We shouldn't have sent out any buffers to the client at this - // point. - CHECK_NE((int)info->mStatus, (int)BufferInfo::OWNED_BY_DOWNSTREAM); - + // At this time some buffers may still be with the component + // or being drained. + if (info->mStatus != BufferInfo::OWNED_BY_COMPONENT && + info->mStatus != BufferInfo::OWNED_BY_DOWNSTREAM) { CHECK_EQ((status_t)OK, freeBuffer(kPortIndexOutput, i)); } } |