From 0affa0eae5cfe5cc9f3bf5cc1499bc3347ff25a2 Mon Sep 17 00:00:00 2001
From: Minghai Shang <minghai@google.com>
Date: Fri, 2 May 2014 12:09:13 -0700
Subject: [PATCH] [spatial svc] Fix one extra frame count during flush

Change-Id: Ia096aafa8aca4f9e58450c4b861393d8f0a15afe
---
 vpx/src/svc_encodeframe.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vpx/src/svc_encodeframe.c b/vpx/src/svc_encodeframe.c
index 76aacd2f45..38c2d26e0e 100644
--- a/vpx/src/svc_encodeframe.c
+++ b/vpx/src/svc_encodeframe.c
@@ -1000,8 +1000,10 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
               (int)si->frame_size, (int)pts);
     }
   }
-  ++si->frame_within_gop;
-  ++si->encode_frame_count;
+  if (rawimg != NULL) {
+    ++si->frame_within_gop;
+    ++si->encode_frame_count;
+  }
 
   return VPX_CODEC_OK;
 }
-- 
GitLab