libmix: A fix to avoid decoding frame twice in case of format change

BZ: 147579

In case of format change, VP8 decoder performs decoding one frame
twice, then two same decoded buffer are output. This patch is to
fix this issue.

Change-Id: I97e75ec6e717328f127104175f7dd1150408c020
Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
diff --git a/videodecoder/VideoDecoderVP8.cpp b/videodecoder/VideoDecoderVP8.cpp
index 2e1180d..24b7315 100644
--- a/videodecoder/VideoDecoderVP8.cpp
+++ b/videodecoder/VideoDecoderVP8.cpp
@@ -146,11 +146,7 @@
     }
 
     status = decodeFrame(buffer, data);
-    CHECK_STATUS("decodeFrame");
-    if (mSizeChanged) {
-        mSizeChanged = false;
-        return DECODE_FORMAT_CHANGE;
-    }
+
     return status;
 }
 
@@ -162,11 +158,16 @@
         return DECODE_SUCCESS;
     }
 
-    if (VP8_KEY_FRAME == data->codec_data->frame_type && !mSizeChanged) {
-        updateFormatInfo(data);
-        if (mSizeChanged == true) {
+    if (VP8_KEY_FRAME == data->codec_data->frame_type) {
+        if (mSizeChanged) {
             mSizeChanged = false;
             return DECODE_FORMAT_CHANGE;
+        } else {
+            updateFormatInfo(data);
+            if (mSizeChanged == true) {
+                mSizeChanged = false;
+                return DECODE_FORMAT_CHANGE;
+            }
         }
     }