am 4b596e10: am d534fee6: am 26dd9bb3: Merge "Fixing Video perf test" into klp-dev

* commit '4b596e102e8e16cb1da163d24131f3b4fecf6b80':
  Fixing Video perf test
diff --git a/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
index bf82067..397b0c6 100644
--- a/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
+++ b/suite/cts/deviceTests/videoperf/src/com/android/cts/videoperf/VideoEncoderDecoderTest.java
@@ -144,7 +144,8 @@
         double[] decoderFpsResults = new double[numberRepeat];
         double[] totalFpsResults = new double[numberRepeat];
         double[] decoderRmsErrorResults = new double[numberRepeat];
-        for (int i = 0; i < numberRepeat; i++) {
+        boolean success = true;
+        for (int i = 0; i < numberRepeat && success; i++) {
             MediaFormat format = new MediaFormat();
             format.setString(MediaFormat.KEY_MIME, mimeType);
             format.setInteger(MediaFormat.KEY_BIT_RATE, infoEnc.mBitRate);
@@ -166,14 +167,14 @@
                         CodecCapabilities.COLOR_FormatYUV420Planar);
             double[] decoderResult = runDecoder(VIDEO_AVC, format);
             if (decoderResult == null) {
-                // color change in the middle. give up
-                return;
+                success = false;
+            } else {
+                double decodingTime = decoderResult[0];
+                decoderRmsErrorResults[i] = decoderResult[1];
+                encoderFpsResults[i] = (double)TOTAL_FRAMES / encodingTime * 1000.0;
+                decoderFpsResults[i] = (double)TOTAL_FRAMES / decodingTime * 1000.0;
+                totalFpsResults[i] = (double)TOTAL_FRAMES / (encodingTime + decodingTime) * 1000.0;
             }
-            double decodingTime = decoderResult[0];
-            decoderRmsErrorResults[i] = decoderResult[1];
-            encoderFpsResults[i] = (double)TOTAL_FRAMES / encodingTime * 1000.0;
-            decoderFpsResults[i] = (double)TOTAL_FRAMES / decodingTime * 1000.0;
-            totalFpsResults[i] = (double)TOTAL_FRAMES / (encodingTime + decodingTime) * 1000.0;
 
             // clear things for re-start
             mEncodedOutputBuffer.clear();