diff options
author | Andy McFadden <fadden@android.com> | 2013-10-24 10:49:11 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-24 10:49:11 -0700 |
commit | f7d89bd79d170be3b299717ac11aff62909314c5 (patch) | |
tree | 941edf7948d8097613f4bd8cc8addec6e3f0b1de /media | |
parent | 72ff30cf3f70c80f2c211d1bb3e98adf5257f3a9 (diff) | |
parent | de5f7cd61df74027834cd1ed2f1e482238f3ed4b (diff) | |
download | frameworks_av-f7d89bd79d170be3b299717ac11aff62909314c5.zip frameworks_av-f7d89bd79d170be3b299717ac11aff62909314c5.tar.gz frameworks_av-f7d89bd79d170be3b299717ac11aff62909314c5.tar.bz2 |
am de5f7cd6: am be567be3: Merge "Check for NULL buffer in repeat-latest" into klp-dev
* commit 'de5f7cd61df74027834cd1ed2f1e482238f3ed4b':
Check for NULL buffer in repeat-latest
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/omx/GraphicBufferSource.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/media/libstagefright/omx/GraphicBufferSource.cpp b/media/libstagefright/omx/GraphicBufferSource.cpp index cf43e94..f295e5a 100644 --- a/media/libstagefright/omx/GraphicBufferSource.cpp +++ b/media/libstagefright/omx/GraphicBufferSource.cpp @@ -384,6 +384,23 @@ bool GraphicBufferSource::repeatLatestSubmittedBuffer_l() { if (mLatestSubmittedBufferId < 0 || mSuspended) { return false; } + if (mBufferSlot[mLatestSubmittedBufferId] == NULL) { + // This can happen if the remote side disconnects, causing + // onBuffersReleased() to NULL out our copy of the slots. The + // buffer is gone, so we have nothing to show. + // + // To be on the safe side we try to release the buffer. + ALOGD("repeatLatestSubmittedBuffer_l: slot was NULL"); + mBufferQueue->releaseBuffer( + mLatestSubmittedBufferId, + mLatestSubmittedBufferFrameNum, + EGL_NO_DISPLAY, + EGL_NO_SYNC_KHR, + Fence::NO_FENCE); + mLatestSubmittedBufferId = -1; + mLatestSubmittedBufferFrameNum = 0; + return false; + } int cbi = findAvailableCodecBuffer_l(); if (cbi < 0) { |