From d76a7a815670da1b5a012fec850410e61c881ef3 Mon Sep 17 00:00:00 2001 From: rigaya Date: Fri, 3 Feb 2017 20:46:44 +0900 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=8C?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=81=E8=A7=A3=E5=83=8F=E5=BA=A6=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=82=82=E3=81=AA=E3=81=91=E3=82=8C=E3=81=B0?= =?UTF-8?q?=E3=80=81=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=93=E3=81=A0SAR?= =?UTF-8?q?=E6=AF=94=E3=82=92=E3=81=9D=E3=81=AE=E3=81=BE=E3=81=BE=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VCECore/VCECore.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/VCECore/VCECore.cpp b/VCECore/VCECore.cpp index a1f1d9e8..41115bba 100644 --- a/VCECore/VCECore.cpp +++ b/VCECore/VCECore.cpp @@ -662,6 +662,13 @@ AMF_RESULT VCECore::checkParam(VCEParam *prm) { PrintMes(VCE_LOG_ERROR, _T("Invalid output frame size - non mod%d (height: %d).\n"), h_mul, m_inputInfo.dstHeight); return AMF_FAIL; } + if ( m_inputInfo.dstWidth == m_inputInfo.dstWidth + && m_inputInfo.dstHeight == m_inputInfo.srcHeight) { + if (m_inputInfo.AspectRatioW * m_inputInfo.AspectRatioH == 0) { + m_inputInfo.AspectRatioW = srcInfo.AspectRatioW; + m_inputInfo.AspectRatioH = srcInfo.AspectRatioH; + } + } if (prm->nCodecId == VCE_CODEC_NONE) { prm->nCodecId = VCE_CODEC_H264; } @@ -1588,8 +1595,10 @@ AMF_RESULT VCECore::init(VCEParam *prm, VCEInputInfo *inputInfo) { PrintMes(VCE_LOG_DEBUG, _T("timeBeginPeriod(1)\n")); } - m_inputInfo.AspectRatioW = prm->nPAR[0]; - m_inputInfo.AspectRatioH = prm->nPAR[1]; + if (prm->nPAR[0] * prm->nPAR[1] > 0) { + m_inputInfo.AspectRatioW = prm->nPAR[0]; + m_inputInfo.AspectRatioH = prm->nPAR[1]; + } if (AMF_OK != (res = initInput(prm, &m_inputInfo))) { return res;