OSDN Git Service

omx node: patch err code to preserve API contract
authorRobert Shih <robertshih@google.com>
Wed, 5 Apr 2017 18:19:28 +0000 (11:19 -0700)
committerRobert Shih <robertshih@google.com>
Wed, 5 Apr 2017 22:33:49 +0000 (22:33 +0000)
Bug: 36789323
Change-Id: Ie1d8dde5e4df8f5f4061cba7b20e1732b1466235
Test: adb shell am instrument -e size small \
  -w android.media.cts/android.support.test.runner.AndroidJUnitRunner

media/libstagefright/omx/OMXNodeInstance.cpp

index 39ed759..807c2ea 100644 (file)
@@ -902,6 +902,9 @@ status_t OMXNodeInstance::storeMetaDataInBuffers_l(
                         ? kMetadataBufferTypeGrallocSource : requestedType;
             err = OMX_SetParameter(mHandle, index, &params);
         }
+        if (err == OMX_ErrorBadParameter) {
+            err = OMX_ErrorUnsupportedIndex;
+        }
     }
 
     // don't log loud error if component does not support metadata mode on the output