diff --git a/filter_common/src/frameserver_common.cpp b/filter_common/src/frameserver_common.cpp index e896360..a2db5e0 100644 --- a/filter_common/src/frameserver_common.cpp +++ b/filter_common/src/frameserver_common.cpp @@ -36,9 +36,11 @@ auto AuxFrameServer::GenerateMediaType(const Format::PixelFormat &pixelFormat, c // assuming the pixel aspect ratio remains the same, new DAR = PAR / new (script) SAR const auto &sourceVideoInfo = FrameServerCommon::GetInstance()._sourceVideoInfo; if (_scriptVideoInfo.width != sourceVideoInfo.width || _scriptVideoInfo.height != sourceVideoInfo.height) { - newVih2->dwPictAspectRatioX = newVih2->dwPictAspectRatioX * sourceVideoInfo.height * _scriptVideoInfo.width; - newVih2->dwPictAspectRatioY = newVih2->dwPictAspectRatioY * sourceVideoInfo.width * _scriptVideoInfo.height; - CoprimeIntegers(newVih2->dwPictAspectRatioX, newVih2->dwPictAspectRatioY); + unsigned long long darX = static_cast(newVih2->dwPictAspectRatioX) * sourceVideoInfo.height * _scriptVideoInfo.width; + unsigned long long darY = static_cast(newVih2->dwPictAspectRatioY) * sourceVideoInfo.width * _scriptVideoInfo.height; + CoprimeIntegers(darX, darY); + newVih2->dwPictAspectRatioX = static_cast(darX); + newVih2->dwPictAspectRatioY = static_cast(darY); } } else { newBmi = &newVih->bmiHeader;