summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/common/evr/evrcustompresenter.cpp7
-rw-r--r--src/plugins/common/evr/evrd3dpresentengine.cpp4
2 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp
index 958204079..b07dbe719 100644
--- a/src/plugins/common/evr/evrcustompresenter.cpp
+++ b/src/plugins/common/evr/evrcustompresenter.cpp
@@ -1350,13 +1350,6 @@ HRESULT EVRCustomPresenter::createOptimalVideoType(IMFMediaType *proposedType, I
// Modify the new type.
- // Set the pixel aspect ratio (PAR) to 1:1 (see assumption #1, above)
- // The ratio is packed in a single UINT64. A helper function is normally available for
- // that (MFSetAttributeRatio) but it's not correctly defined in MinGW 4.9.1.
- hr = mtOptimal->SetUINT64(MF_MT_PIXEL_ASPECT_RATIO, (((UINT64) 1) << 32) | ((UINT64) 1));
- if (FAILED(hr))
- goto done;
-
hr = proposedType->GetUINT64(MF_MT_FRAME_SIZE, &size);
width = int(HI32(size));
height = int(LO32(size));
diff --git a/src/plugins/common/evr/evrd3dpresentengine.cpp b/src/plugins/common/evr/evrd3dpresentengine.cpp
index fd9ccdef1..32d0acf91 100644
--- a/src/plugins/common/evr/evrd3dpresentengine.cpp
+++ b/src/plugins/common/evr/evrd3dpresentengine.cpp
@@ -518,6 +518,10 @@ done:
: qt_evr_pixelFormatFromD3DFormat(d3dFormat),
m_useTextureRendering ? QAbstractVideoBuffer::GLTextureHandle
: QAbstractVideoBuffer::NoHandle);
+ UINT32 horizontal = 1, vertical = 1;
+ hr = MFGetAttributeRatio(format, MF_MT_PIXEL_ASPECT_RATIO, &horizontal, &vertical);
+ if (SUCCEEDED(hr))
+ m_surfaceFormat.setPixelAspectRatio(horizontal, vertical);
} else {
releaseResources();
}