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:
authorAleksoid <aleksoid@users.sourceforge.net>2012-03-15 04:09:30 +0400
committerAleksoid <aleksoid@users.sourceforge.net>2012-03-15 04:09:30 +0400
commitaa38b97d615f562d9ba2bdde11ec9b26dba43e9a (patch)
treec1f4805fce55f5010351dcaad1e36897d1847872
parent5a7aa75614e9ece7b62182298cd119d7ba6be878 (diff)
Fix : MPCVideoDec bad playback VC1 with pulldown in MPEG-TS;
small code refactoring; git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4147 10f7b99b-c216-0410-bff0-8a66a9350fd8
-rw-r--r--src/DSUtil/Mpeg2Def.h8
-rw-r--r--src/filters/parser/MpegSplitter/IMpegSplitterFilter.h2
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.cpp15
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.h2
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitterFile.cpp42
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitterFile.h2
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp26
-rw-r--r--src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp95
-rw-r--r--src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h2
9 files changed, 89 insertions, 105 deletions
diff --git a/src/DSUtil/Mpeg2Def.h b/src/DSUtil/Mpeg2Def.h
index 1aa36becd..8721091a3 100644
--- a/src/DSUtil/Mpeg2Def.h
+++ b/src/DSUtil/Mpeg2Def.h
@@ -154,4 +154,12 @@ enum MPEG2_DESCRIPTOR {
DT_HD_SIMCAST_LOG_CHANNEL = 0x88
};
+enum MPEG_TYPES {
+ mpeg_us,
+ mpeg_ps,
+ mpeg_ts,
+ mpeg_es,
+ mpeg_pva
+};
+
extern const wchar_t *StreamTypeToName(PES_STREAM_TYPE _Type);
diff --git a/src/filters/parser/MpegSplitter/IMpegSplitterFilter.h b/src/filters/parser/MpegSplitter/IMpegSplitterFilter.h
index e5f59c48f..88f64fac3 100644
--- a/src/filters/parser/MpegSplitter/IMpegSplitterFilter.h
+++ b/src/filters/parser/MpegSplitter/IMpegSplitterFilter.h
@@ -50,4 +50,6 @@ public IUnknown {
STDMETHOD(SetAlternativeDuration(BOOL nValue)) = 0;
STDMETHOD_(BOOL, GetAlternativeDuration()) = 0;
+
+ STDMETHOD_(int, GetMPEGType()) = 0;
};
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
index c6efa7e2b..8338e657a 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
@@ -647,7 +647,7 @@ HRESULT CMpegSplitterFilter::DemuxNextPacket(REFERENCE_TIME rtStartOffset)
HRESULT hr;
BYTE b;
- if (m_pFile->m_type == CMpegSplitterFile::ps || m_pFile->m_type == CMpegSplitterFile::es) {
+ if (m_pFile->m_type == mpeg_ps || m_pFile->m_type == mpeg_es) {
if (!m_pFile->NextMpegStartCode(b)) {
return S_FALSE;
}
@@ -695,7 +695,7 @@ HRESULT CMpegSplitterFilter::DemuxNextPacket(REFERENCE_TIME rtStartOffset)
}
m_pFile->Seek(pos + h.len);
}
- } else if (m_pFile->m_type == CMpegSplitterFile::ts) {
+ } else if (m_pFile->m_type == mpeg_ts) {
CMpegSplitterFile::trhdr h;
if (!m_pFile->Read(h)) {
@@ -745,7 +745,7 @@ HRESULT CMpegSplitterFilter::DemuxNextPacket(REFERENCE_TIME rtStartOffset)
}
m_pFile->Seek(h.next);
- } else if (m_pFile->m_type == CMpegSplitterFile::pva) {
+ } else if (m_pFile->m_type == mpeg_pva) {
CMpegSplitterFile::pvahdr h;
if (!m_pFile->Read(h)) {
return S_FALSE;
@@ -797,7 +797,7 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
return hr;
}
- if (m_pFile->m_type == CMpegSplitterFile::ps) {
+ if (m_pFile->m_type == mpeg_ps) {
if (m_pInput && m_pInput->IsConnected() && (GetCLSID(m_pInput->GetConnected()) == GUIDFromCString(_T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}")))) { // MPC VTS Reader
pTI = GetFilterFromPin(m_pInput->GetConnected());
}
@@ -1563,6 +1563,11 @@ STDMETHODIMP_(BOOL) CMpegSplitterFilter::GetAlternativeDuration()
return m_AlternativeDuration;
}
+STDMETHODIMP_(int) CMpegSplitterFilter::GetMPEGType()
+{
+ CAutoLock cAutoLock(&m_csProps);
+ return m_pFile->m_type;
+}
//
// CMpegSourceFilter
//
@@ -2031,7 +2036,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
BYTE* start = p->GetData();
p->SetData(start + 4, p->GetCount() - 4);
// Dolby_AC3
- } else if ((m_type == CMpegSplitterFile::ts) &&
+ } else if ((m_type == mpeg_ts) &&
(m_mt.subtype == MEDIASUBTYPE_DOLBY_AC3) &&
(static_cast<CMpegSplitterFilter*>(m_pFilter))->StreamIsTrueHD(p->TrackNumber) &&
(static_cast<CMpegSplitterFilter*>(m_pFilter))->GetTrueHD() != 2) {
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.h b/src/filters/parser/MpegSplitter/MpegSplitter.h
index 095d1848a..77db82544 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.h
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.h
@@ -136,6 +136,8 @@ public:
STDMETHODIMP SetAlternativeDuration(BOOL nValue);
STDMETHODIMP_(BOOL) GetAlternativeDuration();
+
+ STDMETHODIMP_(int) GetMPEGType();
};
class __declspec(uuid("1365BE7A-C86A-473C-9A41-C0A6E82C9FA3"))
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
index ea201fafd..405393872 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
@@ -31,7 +31,7 @@
CMpegSplitterFile::CMpegSplitterFile(IAsyncReader* pAsyncReader, HRESULT& hr, bool bIsHdmv, CHdmvClipInfo &ClipInfo, int guid_flag, bool ForcedSub, bool TrackPriority, int AC3CoreOnly, bool AlternativeDuration)
: CBaseSplitterFileEx(pAsyncReader, hr, DEFAULT_CACHE_LENGTH, false, true)
- , m_type(us)
+ , m_type(mpeg_us)
, m_rate(0)
, m_rtMin(0), m_rtMax(0)
, m_posMin(0), m_posMax(0)
@@ -55,11 +55,11 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
// get the type first
- m_type = us;
+ m_type = mpeg_us;
Seek(0);
- if (m_type == us) {
+ if (m_type == mpeg_us) {
if (BitRead(32, true) == 'TFrc') {
Seek(0x67c);
}
@@ -68,13 +68,13 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
Seek(h.next);
}
if (cnt >= limit) {
- m_type = ts;
+ m_type = mpeg_ts;
}
}
Seek(0);
- if (m_type == us) {
+ if (m_type == mpeg_us) {
if (BitRead(32, true) == 'TFrc') {
Seek(0xE80);
}
@@ -83,31 +83,31 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
Seek(h.next);
}
if (cnt >= limit) {
- m_type = ts;
+ m_type = mpeg_ts;
}
}
Seek(0);
- if (m_type == us) {
+ if (m_type == mpeg_us) {
int cnt = 0, limit = 4;
for (pvahdr h; cnt < limit && Read(h); cnt++) {
Seek(GetPos() + h.length);
}
if (cnt >= limit) {
- m_type = pva;
+ m_type = mpeg_pva;
}
}
Seek(0);
- if (m_type == us) {
+ if (m_type == mpeg_us) {
BYTE b;
- for (int i = 0; (i < 4 || GetPos() < 65536) && m_type == us && NextMpegStartCode(b); i++) {
+ for (int i = 0; (i < 4 || GetPos() < 65536) && m_type == mpeg_us && NextMpegStartCode(b); i++) {
if (b == 0xba) {
pshdr h;
if (Read(h)) {
- m_type = ps;
+ m_type = mpeg_ps;
m_rate = int(h.bitrate/8);
break;
}
@@ -117,7 +117,7 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
|| b == 0xbd) { // private stream 1, 0xbd, ac3/dts/lpcm/subpic
peshdr h;
if (Read(h, b) && BitRead(24, true) == 0x000001) {
- m_type = es;
+ m_type = mpeg_es;
}
}
}
@@ -125,7 +125,7 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
Seek(0);
- if (m_type == us) {
+ if (m_type == mpeg_us) {
return E_FAIL;
}
@@ -163,7 +163,7 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
}
}
- if (m_type == ts) {
+ if (m_type == mpeg_ts) {
if (IsRandomAccess() || IsStreaming()) {
if (IsStreaming()) {
for (int i = 0; i < 20 || i < 50 && S_OK != HasMoreData(1024*100, 100); i++) {
@@ -214,7 +214,7 @@ HRESULT CMpegSplitterFile::Init(IAsyncReader* pAsyncReader)
#endif
// Add fake Subtitle stream ...
- if (m_type == ts) {
+ if (m_type == mpeg_ts) {
if (m_streams[video].GetCount()) {
if (!m_bIsHdmv && m_streams[subpic].GetCount()) {
stream s;
@@ -274,7 +274,7 @@ REFERENCE_TIME CMpegSplitterFile::NextPTS(DWORD TrackNum)
BYTE b;
while (GetRemaining()) {
- if (m_type == ps || m_type == es) {
+ if (m_type == mpeg_ps || m_type == mpeg_es) {
if (!NextMpegStartCode(b)) { // continue;
ASSERT(0);
break;
@@ -298,7 +298,7 @@ REFERENCE_TIME CMpegSplitterFile::NextPTS(DWORD TrackNum)
Seek(pos + h.len);
}
- } else if (m_type == ts) {
+ } else if (m_type == mpeg_ts) {
trhdr h;
if (!Read(h)) {
continue;
@@ -318,7 +318,7 @@ REFERENCE_TIME CMpegSplitterFile::NextPTS(DWORD TrackNum)
}
Seek(h.next);
- } else if (m_type == pva) {
+ } else if (m_type == mpeg_pva) {
pvahdr h;
if (!Read(h)) {
continue;
@@ -349,7 +349,7 @@ HRESULT CMpegSplitterFile::SearchStreams(__int64 start, __int64 stop, IAsyncRead
while (GetPos() < stop) {
BYTE b;
- if (m_type == ps || m_type == es) {
+ if (m_type == mpeg_ps || m_type == mpeg_es) {
if (!NextMpegStartCode(b)) {
continue;
}
@@ -396,7 +396,7 @@ HRESULT CMpegSplitterFile::SearchStreams(__int64 start, __int64 stop, IAsyncRead
Seek(pos + h.len);
}
}
- } else if (m_type == ts) {
+ } else if (m_type == mpeg_ts) {
trhdr h;
if (!Read(h)) {
continue;
@@ -454,7 +454,7 @@ HRESULT CMpegSplitterFile::SearchStreams(__int64 start, __int64 stop, IAsyncRead
}
Seek(h.next);
- } else if (m_type == pva) {
+ } else if (m_type == mpeg_pva) {
pvahdr h;
if (!Read(h)) {
continue;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.h b/src/filters/parser/MpegSplitter/MpegSplitterFile.h
index 44ab66972..4cb92ef8d 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitterFile.h
+++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.h
@@ -52,7 +52,7 @@ public:
CCritSec m_csProps;
- enum {us, ps, ts, es, pva} m_type;
+ MPEG_TYPES m_type;
REFERENCE_TIME m_rtMin, m_rtMax;
__int64 m_posMin, m_posMax;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
index 9f7443f24..6be5c3ed1 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
@@ -173,24 +173,26 @@ HRESULT CDXVADecoderVC1::DecodeFrame (BYTE* pDataIn, UINT nSize, REFERENCE_TIME
DisplayStatus();
#endif
- // Re-order B frames
+ // Update timestamp & Re-order B frames
if (m_bFrame_repeat_pict || m_pFilter->IsReorderBFrame()) {
if(m_bFrame_repeat_pict) {
m_pFilter->UpdateFrameTime(rtStart, rtStop, !!m_bFrame_repeat_pict);
}
- if (m_PictureParams.bPicBackwardPrediction == 1) {
- SwapRT (rtStart, m_rtStartDelayed);
- SwapRT (rtStop, m_rtStopDelayed);
- } else {
- // Save I or P reference time (swap later)
- if (!m_bFlushed) {
- if (m_nDelayedSurfaceIndex != -1) {
- UpdateStore (m_nDelayedSurfaceIndex, m_rtStartDelayed, m_rtStopDelayed);
- }
- m_rtStartDelayed = m_rtStopDelayed = _I64_MAX;
+ if(m_pFilter->IsReorderBFrame() || m_pFilter->IsEvo()) {
+ if (m_PictureParams.bPicBackwardPrediction == 1) {
SwapRT (rtStart, m_rtStartDelayed);
SwapRT (rtStop, m_rtStopDelayed);
- m_nDelayedSurfaceIndex = nSurfaceIndex;
+ } else {
+ // Save I or P reference time (swap later)
+ if (!m_bFlushed) {
+ if (m_nDelayedSurfaceIndex != -1) {
+ UpdateStore (m_nDelayedSurfaceIndex, m_rtStartDelayed, m_rtStopDelayed);
+ }
+ m_rtStartDelayed = m_rtStopDelayed = _I64_MAX;
+ SwapRT (rtStart, m_rtStartDelayed);
+ SwapRT (rtStop, m_rtStopDelayed);
+ m_nDelayedSurfaceIndex = nSurfaceIndex;
+ }
}
}
}
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
index 1dbb80752..961a4d8bc 100644
--- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
+++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
@@ -558,12 +558,14 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
m_pFrame = NULL;
m_nCodecNb = -1;
m_nCodecId = CODEC_ID_NONE;
- m_rtAvrTimePerFrame = 0;
m_bReorderBFrame = true;
m_DXVADecoderGUID = GUID_NULL;
m_nActiveCodecs = MPCVD_H264|MPCVD_VC1|MPCVD_XVID|MPCVD_DIVX|MPCVD_MSMPEG4|MPCVD_FLASH|MPCVD_WMV|MPCVD_H263|MPCVD_SVQ3|MPCVD_AMVV|MPCVD_THEORA|MPCVD_H264_DXVA|MPCVD_VC1_DXVA|MPCVD_VP356|MPCVD_VP8|MPCVD_MJPEG|MPCVD_INDEO|MPCVD_RV|MPCVD_WMV3_DXVA|MPCVD_MPEG2_DXVA;
+
+ m_rtAvrTimePerFrame = 0;
m_rtLastStart = 0;
m_nCountEstimated = 0;
+ m_rtPrevStop = 0;
m_nWorkaroundBug = FF_BUG_AUTODETECT;
m_nErrorConcealment = FF_EC_DEBLOCK | FF_EC_GUESS_MVS;
@@ -575,14 +577,16 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
m_bDXVACompatible = true;
m_pFFBuffer = NULL;
m_nFFBufferSize = 0;
+ m_pAlignedFFBuffer = NULL;
+ m_nAlignedFFBufferSize = 0;
ResetBuffer();
m_nWidth = 0;
m_nHeight = 0;
m_pSwsContext = NULL;
- m_bUseDXVA = true;
- m_bUseFFmpeg = true;
+ m_bUseDXVA = true;
+ m_bUseFFmpeg = true;
m_nDXVAMode = MODE_SOFTWARE;
m_pDXVADecoder = NULL;
@@ -593,19 +597,13 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
m_nARMode = 1;
m_nDXVACheckCompatibility = 1; // skip level check by default
m_nDXVA_SD = 0;
- m_nPosB = 1;
m_sar.SetSize(1,1);
- m_bWaitingForKeyFrame = TRUE;
-
- m_bTheoraMTSupport = true;
-
- m_rtPrevStop = 0;
-
- m_pAlignedFFBuffer = NULL;
- m_nAlignedFFBufferSize = 0;
-
- m_bFrame_repeat_pict = false;
+ m_bTheoraMTSupport = true;
+ m_bWaitingForKeyFrame = TRUE;
+ m_nPosB = 1;
+ m_bFrame_repeat_pict = false;
+ m_bIsEVO = false;
#ifdef REGISTER_FILTER
CRegKey key;
@@ -673,8 +671,8 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
#ifdef _DEBUG
// Check codec definition table
- int nCodecs = countof(ffCodecs);
- int nPinTypes = countof(sudPinTypesIn);
+ int nCodecs = countof(ffCodecs);
+ int nPinTypes = countof(sudPinTypesIn);
ASSERT (nCodecs == nPinTypes);
for (int i=0; i<nPinTypes; i++) {
ASSERT (ffCodecs[i].clsMinorType == sudPinTypesIn[i].clsMinorType);
@@ -720,30 +718,17 @@ bool CMPCVideoDecFilter::IsVideoInterlaced()
void CMPCVideoDecFilter::UpdateFrameTime (REFERENCE_TIME& rtStart, REFERENCE_TIME& rtStop, bool b_repeat_pict)
{
- if (m_nCodecId == CODEC_ID_VC1 && b_repeat_pict && m_rtAvrTimePerFrame == 333666) { // Fix for EVO+VC1 Pulldown ... thanks to ffdshow to idea
- if(rtStart == _I64_MIN) {
- rtStart = m_rtLastStart + (AVRTIMEPERFRAME_VC1_EVO / m_dRate) * m_nCountEstimated;
- m_nCountEstimated++;
- } else {
- m_rtLastStart = rtStart;
- m_nCountEstimated = 1;
- }
- rtStop = rtStart + (AVRTIMEPERFRAME_VC1_EVO / m_dRate);
- return;
- }
+ REFERENCE_TIME m_rtFrameDuration = (m_nCodecId == CODEC_ID_VC1 && b_repeat_pict && m_rtAvrTimePerFrame == 333666) ? AVRTIMEPERFRAME_VC1_EVO : m_rtAvrTimePerFrame;
- if (rtStart == _I64_MIN) {
- // If reference time has not been set by splitter, extrapolate start time
- // from last known start time already delivered
- rtStart = m_rtLastStart + (m_rtAvrTimePerFrame / m_dRate) * m_nCountEstimated;
+ if ((rtStart == _I64_MIN) || (rtStart <= m_rtPrevStop)) {
+ rtStart = m_rtLastStart + (m_rtFrameDuration / m_dRate) * m_nCountEstimated;
m_nCountEstimated++;
} else {
- // Known start time, set as new reference
m_rtLastStart = rtStart;
m_nCountEstimated = 1;
}
- rtStop = rtStart + (m_rtAvrTimePerFrame / m_dRate);
+ rtStop = rtStart + (m_rtFrameDuration / m_dRate);
}
void CMPCVideoDecFilter::GetOutputSize(int& w, int& h, int& arx, int& ary, int& RealWidth, int& RealHeight)
@@ -1107,21 +1092,24 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction,const CMediaTyp
}
if (nNewCodec != m_nCodecNb) {
+ m_nCodecNb = nNewCodec;
+ m_nCodecId = ffCodecs[nNewCodec].nFFCodec;
- CLSID ClsidSourceFilter = GetCLSID(m_pInput->GetConnected());
+ CLSID ClsidSourceFilter = GetCLSID(m_pInput->GetConnected());
if ((ClsidSourceFilter == __uuidof(COggSourceFilter)) || (ClsidSourceFilter == __uuidof(COggSplitterFilter))) {
m_bTheoraMTSupport = false;
+ } else if ((ClsidSourceFilter == __uuidof(CMpegSourceFilter)) || (ClsidSourceFilter == __uuidof(CMpegSplitterFilter))) {
+ if (IBaseFilter* mpegsp = GetFilterFromPin(m_pInput->GetConnected())) {
+ m_bIsEVO = (m_nCodecId == CODEC_ID_VC1 && mpeg_ps == (static_cast<CMpegSplitterFilter*>(mpegsp))->GetMPEGType());
+ }
}
- m_nCodecNb = nNewCodec;
-
m_bReorderBFrame = true;
- m_nCodecId = ffCodecs[nNewCodec].nFFCodec;
m_pAVCodec = avcodec_find_decoder(m_nCodecId);
CheckPointer (m_pAVCodec, VFW_E_UNSUPPORTED_VIDEO);
m_pAVCtx = avcodec_alloc_context3(m_pAVCodec);
- CheckPointer (m_pAVCtx, E_POINTER);
+ CheckPointer (m_pAVCtx, E_POINTER);
int nThreadNumber = m_nThreadNumber ? m_nThreadNumber : m_pCpuId->GetProcessorNumber();
if ((nThreadNumber > 1) && IsMultiThreadSupported (m_nCodecId)) {
@@ -1941,45 +1929,20 @@ HRESULT CMPCVideoDecFilter::Transform(IMediaSample* pIn)
HRESULT hr;
BYTE* pDataIn;
int nSize;
- REFERENCE_TIME rtStart = _I64_MIN;
- REFERENCE_TIME rtStop = _I64_MIN;
+ REFERENCE_TIME rtStart = _I64_MIN;
+ REFERENCE_TIME rtStop = _I64_MIN;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
- nSize = pIn->GetActualDataLength();
+ nSize = pIn->GetActualDataLength();
hr = pIn->GetTime(&rtStart, &rtStop);
- // FIXE THIS PART TO EVO_SUPPORT (insure m_rtAvrTimePerFrame is not estimated if not needed!!)
- //if (rtStart != _I64_MIN)
- //{
- // // Estimate rtStart/rtStop if not set by parser (EVO support)
- // if (m_nCountEstimated > 0)
- // {
- // m_rtAvrTimePerFrame = (rtStart - m_rtLastStart) / m_nCountEstimated;
-
- // ROUND_FRAMERATE (m_rtAvrTimePerFrame, 417083); // 23.97 fps
- // ROUND_FRAMERATE (m_rtAvrTimePerFrame, 333667); // 29.97 fps
- // ROUND_FRAMERATE (m_rtAvrTimePerFrame, 400000); // 25.00 fps
- // }
- // m_rtLastStart = rtStart;
- // m_nCountEstimated = 0;
- //}
- //else
- //{
- // m_nCountEstimated++;
- // rtStart = rtStop = m_rtLastStart + m_nCountEstimated*m_rtAvrTimePerFrame;
- //}
-
if (FAILED(hr)) {
rtStart = rtStop = _I64_MIN;
}
- if (rtStop <= rtStart && rtStop != _I64_MIN) {
- rtStop = rtStart + m_rtAvrTimePerFrame / m_dRate;
- }
-
if (m_nDXVAMode == MODE_SOFTWARE) {
UpdateFrameTime(rtStart, rtStop, m_bFrame_repeat_pict);
}
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h
index 3382d75f0..b7154b53c 100644
--- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h
+++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h
@@ -116,6 +116,7 @@ protected:
int m_nHeight; // Frame height give to input pin
bool m_bTheoraMTSupport;
+ bool m_bIsEVO;
// Buffer management for truncated stream (store stream chunks & reference time sent by splitter)
BYTE* m_pFFBuffer;
@@ -269,6 +270,7 @@ public:
inline AVFrame* GetFrame() { return m_pFrame; };
inline enum CodecID GetCodec() { return m_nCodecId; };
inline bool IsReorderBFrame() { return m_bReorderBFrame; };
+ inline bool IsEvo() { return m_bIsEVO; };
inline DWORD GetPCIVendor() { return m_nPCIVendor; };
inline REFERENCE_TIME GetAvrTimePerFrame() { return m_rtAvrTimePerFrame; };
inline double GetRate() { return m_dRate; };