diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-01-25 01:37:37 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-01-25 02:06:21 +0400 |
commit | fe65610d8367d1ff614d941d02f5e0710239e47f (patch) | |
tree | 0c56fcada5e963e19a304ba24b2a0057c0465aaa | |
parent | 461a0656f8571d50ad595a9eb255f2e12083f42e (diff) |
MPC Video Decoder: The "Read AR from stream" option was sometimes not working correctly.
-rw-r--r-- | docs/Changelog.txt | 1 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/Changelog.txt b/docs/Changelog.txt index 95d102ff9..e1c464de8 100644 --- a/docs/Changelog.txt +++ b/docs/Changelog.txt @@ -36,6 +36,7 @@ Legend: - Fix volume slider going out of bounds with IE in player.html
- Fix incorrect encoding of the parent dir's path in browser.html
! MPC Video Decoder: Fix low merit internal filter.
+! MPC Video Decoder: The "Read Aspect Ratio from stream" option was sometimes not working correctly.
! Ticket #2423, Fix wrong rounding leading to small black bars when resizing the window.
This was mostly visible when using the "auto-fit" zoom or when resizing manually.
! Ticket #2783, Fix crash when generating the chapter marks
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index 78973a5f7..940aa8e15 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -1242,7 +1242,20 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy }
}
- return __super::SetMediaType(direction, pmt);
+ HRESULT hr = __super::SetMediaType(direction, pmt);
+
+ if (dir == PINDIR_INPUT) {
+ // Compute the expected Sample AR
+ m_sar.cx = m_arx * m_h;
+ m_sar.cy = m_ary * m_w;
+ int lnko = LNKO(m_sar.cx, m_sar.cy);
+ if (lnko > 1) {
+ m_sar.cx /= lnko;
+ m_sar.cy /= lnko;
+ }
+ }
+
+ return hr;
}
VIDEO_OUTPUT_FORMATS DXVAFormats[] = { // DXVA2
|