summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-01-14 11:32:13 -0800
committerAndreas Huber <andih@google.com>2010-01-14 14:09:58 -0800
commitb03fd8c97695d381e202f6a64989b51c7024c04a (patch)
tree62fed85303aadb2300d9f3cb9edaf28f5a715f36 /media
parent7be6407f2ad7f2b0782d195d9f792072c084d6f5 (diff)
downloadframeworks_av-b03fd8c97695d381e202f6a64989b51c7024c04a.zip
frameworks_av-b03fd8c97695d381e202f6a64989b51c7024c04a.tar.gz
frameworks_av-b03fd8c97695d381e202f6a64989b51c7024c04a.tar.bz2
Workaround for some hardware decoders not properly signaling end-of-output-stream properly.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/OMXCodec.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index d8bd25d..c4d3b5d 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1786,6 +1786,21 @@ void OMXCodec::enablePortAsync(OMX_U32 portIndex) {
void OMXCodec::fillOutputBuffers() {
CHECK_EQ(mState, EXECUTING);
+ // This is a workaround for some decoders not properly reporting
+ // end-of-output-stream. If we own all input buffers and also own
+ // all output buffers and we already signalled end-of-input-stream,
+ // the end-of-output-stream is implied.
+ if (mSignalledEOS
+ && countBuffersWeOwn(mPortBuffers[kPortIndexInput])
+ == mPortBuffers[kPortIndexInput].size()
+ && countBuffersWeOwn(mPortBuffers[kPortIndexOutput])
+ == mPortBuffers[kPortIndexOutput].size()) {
+ mNoMoreOutputData = true;
+ mBufferFilled.signal();
+
+ return;
+ }
+
Vector<BufferInfo> *buffers = &mPortBuffers[kPortIndexOutput];
for (size_t i = 0; i < buffers->size(); ++i) {
fillOutputBuffer(&buffers->editItemAt(i));
@@ -1833,6 +1848,8 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) {
mNoMoreOutputData = false;
+ CODEC_LOGV("calling emptyBuffer with codec specific data");
+
status_t err = mOMX->emptyBuffer(
mNode, info->mBuffer, 0, size,
OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_CODECCONFIG,