Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-01-25 02:07:42 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-01-25 02:07:42 +0400
commitc87609f354011fd6ce46f16a2f865d8b814d47df (patch)
tree1830f6e470ff16c8d99a9fb40d198e3171b0a833 /src/filters/transform/Mpeg2DecFilter
parentfe65610d8367d1ff614d941d02f5e0710239e47f (diff)
MPEG2 Video Decoder: The "Read AR from stream" option was sometimes not working correctly.
Diffstat (limited to 'src/filters/transform/Mpeg2DecFilter')
-rw-r--r--src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp18
-rw-r--r--src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h3
2 files changed, 20 insertions, 1 deletions
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
index 9593c5522..2ee3592fb 100644
--- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
+++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
@@ -1020,6 +1020,24 @@ HRESULT CMpeg2DecFilter::CheckTransform(const CMediaType* mtIn, const CMediaType
: VFW_E_TYPE_NOT_ACCEPTED;
}
+HRESULT CMpeg2DecFilter::SetMediaType(PIN_DIRECTION dir, const CMediaType* pmt)
+{
+ HRESULT hr = __super::SetMediaType(dir, pmt);
+
+ if (dir == PINDIR_INPUT) {
+ // Compute the expected Pixel AR
+ m_par.cx = m_arx * m_h;
+ m_par.cy = m_ary * m_w;
+ int lnko = LNKO(m_par.cx, m_par.cy);
+ if (lnko > 1) {
+ m_par.cx /= lnko;
+ m_par.cy /= lnko;
+ }
+ }
+
+ return hr;
+}
+
DWORD g_clock;
HRESULT CMpeg2DecFilter::StartStreaming()
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
index 98d9d4e0e..8d1908a9a 100644
--- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
+++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -137,6 +137,7 @@ public:
HRESULT CheckConnect(PIN_DIRECTION dir, IPin* pPin);
HRESULT CheckInputType(const CMediaType* mtIn);
HRESULT CheckTransform(const CMediaType* mtIn, const CMediaType* mtOut);
+ HRESULT SetMediaType(PIN_DIRECTION dir, const CMediaType* pmt);
HRESULT StartStreaming();
HRESULT StopStreaming();