Merge "mm-video-v4l2: venc: fix the initial value for P/B frames"
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index 0967944..83cf11e 100644
--- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -343,14 +343,8 @@
 
     OMX_INIT_STRUCT(&m_sIntraperiod, QOMX_VIDEO_INTRAPERIODTYPE);
     m_sIntraperiod.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
-    m_sIntraperiod.nPFrames = (m_sConfigFramerate.xEncodeFramerate * 2) - 1;
-    /* Consider a scenario where client does get of this and does not modify this
-       and does a set. Then if by default if this is 0 we assume that client is explicitly
-       requesting disabling of B-Frames and our logic to automatically enable bFrames will
-       fail(We do not enable bframes if there is a set of this param with 0 value). We do
-       not want this to happen(also all our default values support auto enabling of B-Frames).
-       We always take care of scenarios where bframes need to be disabled */
-    m_sIntraperiod.nBFrames = 1;
+    m_sIntraperiod.nPFrames = ((m_sConfigFramerate.xEncodeFramerate >> 16) * 2) - 1;
+    m_sIntraperiod.nBFrames = 0;
 
 
     OMX_INIT_STRUCT(&m_sErrorCorrection, OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE);