libmix: correct actual buffer count for AVC

BZ: 185530

Correct actual buffer count for AVC.

Change-Id: Id836390a5be0d60c4de88651d999e482ac49b755
Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index bf2df90..03abb3b 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -772,9 +772,8 @@
         }
     }
 
-    int DPBSize = getDPBSize(data);
     // considering there is a B frame to be output, which needs to be exclued in output queue
-    int diff = DPBSize - (mOutputWindowSize - 1);
+    int diff = data->codec_data->num_ref_frames + 1 - (mOutputWindowSize - 1);
 
     if (mConfigBuffer.flag & WANT_SURFACE_PROTECTION) {
         mVideoFormatInfo.actualBufferNeeded = mConfigBuffer.surfaceNumber;