mm-video: vdec: honor resolution set on output only if scalar is enabled

Use client supplied dimensions on output port only in case
scalar is enabled.

Change-Id: I243896a0928da765cc5dd42e4e31474e0c03317a
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 55d233b..05ca376 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -643,6 +643,7 @@
     client_buffers.set_vdec_client(this);
     dynamic_buf_mode = false;
     out_dynamic_list = NULL;
+    is_down_scalar_enabled = false;
 }
 
 static const int event_type[] = {
@@ -2899,7 +2900,11 @@
                                    DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition OP port");
                                    m_display_id = portDefn->format.video.pNativeWindow;
                                    unsigned int buffer_size;
-                                      DEBUG_PRINT_LOW("\n SetParam OP: WxH(%lu x %lu)\n",
+                                   /* update output port resolution with client supplied dimensions
+                                      in case scaling is enabled, else it follows input resolution set
+                                   */
+                                   if (is_down_scalar_enabled) {
+                                       DEBUG_PRINT_LOW("\n SetParam OP: WxH(%lu x %lu)\n",
                                                portDefn->format.video.nFrameWidth,
                                                portDefn->format.video.nFrameHeight);
                                        if (portDefn->format.video.nFrameHeight != 0x0 &&
@@ -2923,7 +2928,7 @@
                                            } else
                                                eRet = get_buffer_req(&drv_ctx.op_buf);
                                        }
-
+                                   }
                                    if (!client_buffers.get_buffer_req(buffer_size)) {
                                        DEBUG_PRINT_ERROR("Error in getting buffer requirements");
                                        eRet = OMX_ErrorBadParameter;