OSDN Git Service

Log which OMX component is not returning all buffers to us on executing->idle.
authorAndreas Huber <andih@google.com>
Tue, 15 May 2012 23:13:23 +0000 (16:13 -0700)
committerAndreas Huber <andih@google.com>
Tue, 15 May 2012 23:13:23 +0000 (16:13 -0700)
Change-Id: I8cd102cc5b1f3c9c36e3c5832ae4bee75c471efd
related-to-bug: 6498711

media/libstagefright/OMXCodec.cpp

index 6083cd4..ba8dd57 100755 (executable)
@@ -2588,13 +2588,23 @@ void OMXCodec::onStateChange(OMX_STATETYPE newState) {
             } else {
                 CHECK_EQ((int)mState, (int)EXECUTING_TO_IDLE);
 
-                CHECK_EQ(
-                    countBuffersWeOwn(mPortBuffers[kPortIndexInput]),
-                    mPortBuffers[kPortIndexInput].size());
+                if (countBuffersWeOwn(mPortBuffers[kPortIndexInput]) !=
+                    mPortBuffers[kPortIndexInput].size()) {
+                    ALOGE("Codec did not return all input buffers "
+                          "(received %d / %d)",
+                            countBuffersWeOwn(mPortBuffers[kPortIndexInput]),
+                            mPortBuffers[kPortIndexInput].size());
+                    TRESPASS();
+                }
 
-                CHECK_EQ(
-                    countBuffersWeOwn(mPortBuffers[kPortIndexOutput]),
-                    mPortBuffers[kPortIndexOutput].size());
+                if (countBuffersWeOwn(mPortBuffers[kPortIndexOutput]) !=
+                    mPortBuffers[kPortIndexOutput].size()) {
+                    ALOGE("Codec did not return all output buffers "
+                          "(received %d / %d)",
+                            countBuffersWeOwn(mPortBuffers[kPortIndexOutput]),
+                            mPortBuffers[kPortIndexOutput].size());
+                    TRESPASS();
+                }
 
                 status_t err = mOMX->sendCommand(
                         mNode, OMX_CommandStateSet, OMX_StateLoaded);