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-05-07 23:51:09 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-05-09 16:57:30 +0400
commit2acb3c5749326e59f6f2c6f48692a32dc7e705f5 (patch)
tree4b6985d401ea648b1562c3b4a6bb868e61c5105d /src/filters
parentae3db48090dc9837fbb439503075521e356dcfa7 (diff)
Use nullptr instead of NULL whenever possible.
Microsoft recommends to avoid using NULL or zero (0) as a null pointer constant since nullptr is less vulnerable to misuse and works better in most situations. Also fix some cases where NULL was used instead of 0 or FALSE.
Diffstat (limited to 'src/filters')
-rw-r--r--src/filters/InternalPropertyPage.cpp14
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxer.cpp18
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp6
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp10
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerRelatedPin.cpp4
-rw-r--r--src/filters/muxer/BaseMuxer/BitStream.cpp12
-rw-r--r--src/filters/muxer/DSMMuxer/DSMMuxer.cpp14
-rw-r--r--src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp30
-rw-r--r--src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp24
-rw-r--r--src/filters/muxer/WavDest/WavDest.cpp8
-rw-r--r--src/filters/parser/AviSplitter/AviFile.cpp6
-rw-r--r--src/filters/parser/AviSplitter/AviSplitter.cpp24
-rw-r--r--src/filters/parser/BaseSplitter/AsyncReader.cpp16
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.cpp32
-rw-r--r--src/filters/parser/BaseSplitter/MultiFiles.cpp10
-rw-r--r--src/filters/parser/DSMSplitter/DSMSplitter.cpp16
-rw-r--r--src/filters/parser/FLVSplitter/FLVSplitter.cpp14
-rw-r--r--src/filters/parser/MP4Splitter/MP4Splitter.cpp38
-rw-r--r--src/filters/parser/MP4Splitter/MP4SplitterFile.cpp6
-rw-r--r--src/filters/parser/MatroskaSplitter/MatroskaFile.cpp14
-rw-r--r--src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp54
-rw-r--r--src/filters/parser/MpaSplitter/MpaSplitter.cpp16
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.cpp60
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitterFile.cpp12
-rw-r--r--src/filters/parser/OggSplitter/OggSplitter.cpp18
-rw-r--r--src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp78
-rw-r--r--src/filters/parser/StreamDriveThru/StreamDriveThru.cpp20
-rw-r--r--src/filters/reader/CDDAReader/CDDAReader.cpp12
-rw-r--r--src/filters/reader/CDXAReader/CDXAReader.cpp18
-rw-r--r--src/filters/reader/UDPReader/UDPReader.cpp10
-rw-r--r--src/filters/reader/VTSReader/VTSReader.cpp14
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp158
-rw-r--r--src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp8
-rw-r--r--src/filters/renderer/SyncClock/SyncClock.cpp6
-rw-r--r--src/filters/renderer/VideoRenderers/AllocatorCommon.cpp16
-rw-r--r--src/filters/renderer/VideoRenderers/AllocatorCommon7.cpp8
-rw-r--r--src/filters/renderer/VideoRenderers/D3DFont.cpp58
-rw-r--r--src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp68
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp108
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp90
-rw-r--r--src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp14
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp82
-rw-r--r--src/filters/renderer/VideoRenderers/IPinHook.cpp96
-rw-r--r--src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp10
-rw-r--r--src/filters/renderer/VideoRenderers/QT7AllocatorPresenter.cpp18
-rw-r--r--src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp12
-rw-r--r--src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp38
-rw-r--r--src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp20
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp292
-rw-r--r--src/filters/renderer/VideoRenderers/VMR7AllocatorPresenter.cpp10
-rw-r--r--src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp10
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp22
-rw-r--r--src/filters/source/BaseSource/BaseSource.cpp2
-rw-r--r--src/filters/source/D2VSource/D2VSource.cpp8
-rw-r--r--src/filters/source/DTSAC3Source/DTSAC3Source.cpp6
-rw-r--r--src/filters/source/FLACSource/FLACSource.cpp12
-rw-r--r--src/filters/source/FLICSource/FLICSource.cpp6
-rw-r--r--src/filters/source/ShoutcastSource/ShoutcastSource.cpp14
-rw-r--r--src/filters/source/SubtitleSource/SubtitleSource.cpp20
-rw-r--r--src/filters/switcher/AudioSwitcher/Audio.cpp2
-rw-r--r--src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp12
-rw-r--r--src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp66
-rw-r--r--src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp16
-rw-r--r--src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp16
-rw-r--r--src/filters/transform/BufferFilter/BufferFilter.cpp16
-rw-r--r--src/filters/transform/DeCSSFilter/DeCSSFilter.cpp16
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoder.cpp30
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp4
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp8
-rw-r--r--src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp6
-rw-r--r--src/filters/transform/MPCVideoDec/FfmpegContext.cpp22
-rw-r--r--src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp6
-rw-r--r--src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp348
-rw-r--r--src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp4
-rw-r--r--src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp20
-rw-r--r--src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp6
-rw-r--r--src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp22
-rw-r--r--src/filters/transform/MpaDecFilter/Mixer.cpp4
-rw-r--r--src/filters/transform/MpaDecFilter/MpaDecFilter.cpp36
-rw-r--r--src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp32
-rw-r--r--src/filters/transform/VSFilter/DirectVobSub.cpp4
-rw-r--r--src/filters/transform/VSFilter/DirectVobSubFilter.cpp62
-rw-r--r--src/filters/transform/VSFilter/DirectVobSubPropPage.cpp28
-rw-r--r--src/filters/transform/VSFilter/StyleEditorDialog.cpp4
-rw-r--r--src/filters/transform/VSFilter/Systray.cpp14
-rw-r--r--src/filters/transform/VSFilter/VSFilter.cpp12
-rw-r--r--src/filters/transform/VSFilter/csriapi.cpp2
-rw-r--r--src/filters/transform/VSFilter/plugins.cpp80
89 files changed, 1371 insertions, 1371 deletions
diff --git a/src/filters/InternalPropertyPage.cpp b/src/filters/InternalPropertyPage.cpp
index 331fee381..648b9e751 100644
--- a/src/filters/InternalPropertyPage.cpp
+++ b/src/filters/InternalPropertyPage.cpp
@@ -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.
*
@@ -108,7 +108,7 @@ END_MESSAGE_MAP()
CInternalPropertyPage::CInternalPropertyPage(LPUNKNOWN lpunk, HRESULT* phr)
: CUnknown(_T("CInternalPropertyPage"), lpunk)
- , m_pWnd(NULL)
+ , m_pWnd(nullptr)
{
if (phr) {
*phr = S_OK;
@@ -123,7 +123,7 @@ CInternalPropertyPage::~CInternalPropertyPage()
m_pWnd->DestroyWindow();
}
delete m_pWnd;
- m_pWnd = NULL;
+ m_pWnd = nullptr;
}
}
@@ -208,8 +208,8 @@ STDMETHODIMP CInternalPropertyPage::GetPageInfo(PROPPAGEINFO* pPageInfo)
pPageInfo->cb = sizeof(PROPPAGEINFO);
pPageInfo->pszTitle = pszTitle;
- pPageInfo->pszDocString = NULL;
- pPageInfo->pszHelpFile = NULL;
+ pPageInfo->pszDocString = nullptr;
+ pPageInfo->pszHelpFile = nullptr;
pPageInfo->dwHelpContext = 0;
pPageInfo->size = GetWindowSize();
@@ -240,7 +240,7 @@ STDMETHODIMP CInternalPropertyPage::SetObjects(ULONG cObjects, LPUNKNOWN* ppUnk)
if (!m_pWnd->OnConnect(m_pUnks)) {
delete m_pWnd;
- m_pWnd = NULL;
+ m_pWnd = nullptr;
return E_FAIL;
}
@@ -249,7 +249,7 @@ STDMETHODIMP CInternalPropertyPage::SetObjects(ULONG cObjects, LPUNKNOWN* ppUnk)
m_pWnd->DestroyWindow();
delete m_pWnd;
- m_pWnd = NULL;
+ m_pWnd = nullptr;
}
return S_OK;
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxer.cpp b/src/filters/muxer/BaseMuxer/BaseMuxer.cpp
index fa719f9ea..1a410f270 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxer.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxer.cpp
@@ -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.
*
@@ -45,7 +45,7 @@ STDMETHODIMP CBaseMuxerFilter::NonDelegatingQueryInterface(REFIID riid, void** p
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
QI(IMediaSeeking)
@@ -73,7 +73,7 @@ void CBaseMuxerFilter::AddInput()
name.Format(L"Input %d", m_pInputs.GetCount() + 1);
- CBaseMuxerInputPin* pInputPin = NULL;
+ CBaseMuxerInputPin* pInputPin = nullptr;
if (FAILED(CreateInput(name, &pInputPin)) || !pInputPin) {
ASSERT(0);
return;
@@ -82,7 +82,7 @@ void CBaseMuxerFilter::AddInput()
name.Format(L"~Output %d", m_pRawOutputs.GetCount() + 1);
- CBaseMuxerRawOutputPin* pRawOutputPin = NULL;
+ CBaseMuxerRawOutputPin* pRawOutputPin = nullptr;
if (FAILED(CreateRawOutput(name, &pRawOutputPin)) || !pRawOutputPin) {
ASSERT(0);
return;
@@ -126,7 +126,7 @@ DWORD CBaseMuxerFilter::ThreadProc()
switch (cmd) {
default:
case CMD_EXIT:
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
Reply(S_OK);
return 0;
@@ -152,7 +152,7 @@ DWORD CBaseMuxerFilter::ThreadProc()
try {
MuxHeaderInternal();
- while (!CheckRequest(NULL) && m_pActivePins.GetCount()) {
+ while (!CheckRequest(nullptr) && m_pActivePins.GetCount()) {
if (m_State == State_Paused) {
Sleep(10);
continue;
@@ -196,7 +196,7 @@ DWORD CBaseMuxerFilter::ThreadProc()
ASSERT(0); // this function should only return via CMD_EXIT
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
return 0;
}
@@ -267,7 +267,7 @@ void CBaseMuxerFilter::MuxFooterInternal()
CAutoPtr<MuxerPacket> CBaseMuxerFilter::GetPacket()
{
REFERENCE_TIME rtMin = _I64_MAX;
- CBaseMuxerInputPin* pPinMin = NULL;
+ CBaseMuxerInputPin* pPinMin = nullptr;
int i = int(m_pActivePins.GetCount());
POSITION pos = m_pActivePins.GetHeadPosition();
@@ -342,7 +342,7 @@ CBasePin* CBaseMuxerFilter::GetPin(int n)
n -= int(m_pRawOutputs.GetCount());
- return NULL;
+ return nullptr;
}
STDMETHODIMP CBaseMuxerFilter::Stop()
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
index 982a8b4f2..9d8ed5bf2 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp
@@ -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.
*
@@ -173,7 +173,7 @@ HRESULT CBaseMuxerInputPin::CompleteConnect(IPin* pReceivePin)
HRESULT hr2;
CComVariant var;
- if (SUCCEEDED(pPB->Read(1, &PropBag, NULL, &var, &hr2)) && SUCCEEDED(hr2)) {
+ if (SUCCEEDED(pPB->Read(1, &PropBag, nullptr, &var, &hr2)) && SUCCEEDED(hr2)) {
SetProperty(PropBag.pstrName, &var);
}
@@ -224,7 +224,7 @@ STDMETHODIMP CBaseMuxerInputPin::Receive(IMediaSample* pSample)
long len = pSample->GetActualDataLength();
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (FAILED(pSample->GetPointer(&pData)) || !pData) {
return S_OK;
}
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
index fa886de46..d95fadc2d 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
@@ -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.
*
@@ -51,7 +51,7 @@ IBitStream* CBaseMuxerOutputPin::GetBitStream()
HRESULT CBaseMuxerOutputPin::BreakConnect()
{
- m_pBitStream = NULL;
+ m_pBitStream = nullptr;
return __super::BreakConnect();
}
@@ -108,7 +108,7 @@ HRESULT CBaseMuxerOutputPin::GetMediaType(int iPosition, CMediaType* pmt)
HRESULT CBaseMuxerOutputPin::DeliverEndOfStream()
{
- m_pBitStream = NULL;
+ m_pBitStream = nullptr;
return __super::DeliverEndOfStream();
}
@@ -444,8 +444,8 @@ void CBaseMuxerRawOutputPin::MuxFooter(const CMediaType& mt)
pBitStream->ByteWrite(&size, 4);
} else if (mt.subtype == MEDIASUBTYPE_VOBSUB) {
if (CComQIPtr<IFileSinkFilter> pFSF = GetFilterFromPin(GetConnected())) {
- WCHAR* fn = NULL;
- if (SUCCEEDED(pFSF->GetCurFile(&fn, NULL))) {
+ WCHAR* fn = nullptr;
+ if (SUCCEEDED(pFSF->GetCurFile(&fn, nullptr))) {
CPathW p(fn);
p.RenameExtension(L".idx");
CoTaskMemFree(fn);
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerRelatedPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerRelatedPin.cpp
index 29726c8a3..2505c3dba 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxerRelatedPin.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxerRelatedPin.cpp
@@ -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.
*
@@ -27,7 +27,7 @@
//
CBaseMuxerRelatedPin::CBaseMuxerRelatedPin()
- : m_pRelatedPin(NULL)
+ : m_pRelatedPin(nullptr)
{
}
diff --git a/src/filters/muxer/BaseMuxer/BitStream.cpp b/src/filters/muxer/BaseMuxer/BitStream.cpp
index 9f4d55e2f..e4197cf39 100644
--- a/src/filters/muxer/BaseMuxer/BitStream.cpp
+++ b/src/filters/muxer/BaseMuxer/BitStream.cpp
@@ -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.
*
@@ -27,7 +27,7 @@
//
CBitStream::CBitStream(IStream* pStream, bool fThrowError)
- : CUnknown(_T("CBitStream"), NULL)
+ : CUnknown(_T("CBitStream"), nullptr)
, m_pStream(pStream)
, m_fThrowError(fThrowError)
, m_bitlen(0)
@@ -35,7 +35,7 @@ CBitStream::CBitStream(IStream* pStream, bool fThrowError)
ASSERT(m_pStream);
LARGE_INTEGER li = {0};
- m_pStream->Seek(li, STREAM_SEEK_SET, NULL);
+ m_pStream->Seek(li, STREAM_SEEK_SET, nullptr);
ULARGE_INTEGER uli = {0};
m_pStream->SetSize(uli); // not that it worked...
@@ -52,7 +52,7 @@ STDMETHODIMP CBitStream::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
QI(IBitStream)
@@ -117,7 +117,7 @@ STDMETHODIMP CBitStream::BitWrite(UINT64 data, int len)
while (m_bitlen >= 8) {
BYTE b = (BYTE)(m_bitbuff >> (m_bitlen - 8));
- hr = m_pStream->Write(&b, 1, NULL);
+ hr = m_pStream->Write(&b, 1, nullptr);
m_bitlen -= 8;
ASSERT(SUCCEEDED(hr));
@@ -136,7 +136,7 @@ STDMETHODIMP CBitStream::BitFlush()
if (m_bitlen > 0) {
ASSERT(m_bitlen < 8);
BYTE b = (BYTE)(m_bitbuff << (8 - m_bitlen));
- hr = m_pStream->Write(&b, 1, NULL);
+ hr = m_pStream->Write(&b, 1, nullptr);
m_bitlen = 0;
ASSERT(SUCCEEDED(hr));
diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp
index add9233cc..deaee0cb7 100644
--- a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp
+++ b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp
@@ -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.
*
@@ -37,8 +37,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, TRUE, &CLSID_NULL, NULL, 0, NULL},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, TRUE, &CLSID_NULL, nullptr, 0, nullptr},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -46,7 +46,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDSMMuxerFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDSMMuxerFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -103,7 +103,7 @@ STDMETHODIMP CDSMMuxerFilter::NonDelegatingQueryInterface(REFIID riid, void** pp
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
__super::NonDelegatingQueryInterface(riid, ppv);
@@ -240,9 +240,9 @@ void CDSMMuxerFilter::MuxHeader(IBitStream* pBS)
for (DWORD i = 0, j = pRB->ResGetCount(); i < j; i++) {
CComBSTR name, desc, mime;
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
DWORD len = 0;
- if (SUCCEEDED(pRB->ResGet(i, &name, &desc, &mime, &pData, &len, NULL))) {
+ if (SUCCEEDED(pRB->ResGet(i, &name, &desc, &mime, &pData, &len, nullptr))) {
CStringA utf8_name = UTF16To8(name);
CStringA utf8_desc = UTF16To8(desc);
CStringA utf8_mime = UTF16To8(mime);
diff --git a/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp b/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
index b3c62ef2f..7835daf77 100644
--- a/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
+++ b/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
@@ -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.
*
@@ -50,7 +50,7 @@ HRESULT CID::Write(IStream* pStream)
DWORD id = m_id;
bswap((BYTE*)&id, (int)len);
*(BYTE*)&id = ((*(BYTE*)&id) & (1 << (8 - len)) - 1) | (1 << (8 - len));
- return pStream->Write(&id, (ULONG)len, NULL);
+ return pStream->Write(&id, (ULONG)len, nullptr);
}
MatroskaWriter::QWORD CID::HeaderSize(MatroskaWriter::QWORD len)
@@ -86,7 +86,7 @@ HRESULT CBinary::Write(IStream* pStream)
}
HeaderWrite(pStream);
- return pStream->Write(GetData(), GetCount(), NULL);
+ return pStream->Write(GetData(), GetCount(), nullptr);
}
MatroskaWriter::QWORD CANSI::Size(bool fWithHeader)
@@ -110,7 +110,7 @@ HRESULT CANSI::Write(IStream* pStream)
}
HeaderWrite(pStream);
- return pStream->Write((LPCSTR) * this, GetLength(), NULL);
+ return pStream->Write((LPCSTR) * this, GetLength(), nullptr);
}
MatroskaWriter::QWORD CUTF8::Size(bool fWithHeader)
@@ -135,7 +135,7 @@ HRESULT CUTF8::Write(IStream* pStream)
HeaderWrite(pStream);
CStringA str = UTF16To8(*this);
- return pStream->Write((BYTE*)(LPCSTR)str, str.GetLength(), NULL);
+ return pStream->Write((BYTE*)(LPCSTR)str, str.GetLength(), nullptr);
}
template<class T, class BASE>
@@ -163,7 +163,7 @@ HRESULT CSimpleVar<T, BASE>::Write(IStream* pStream)
HeaderWrite(pStream);
T val = m_val;
bswap((BYTE*)&val, sizeof(T));
- return pStream->Write(&val, sizeof(T), NULL);
+ return pStream->Write(&val, sizeof(T), nullptr);
}
MatroskaWriter::QWORD CUInt::Size(bool fWithHeader)
@@ -201,7 +201,7 @@ HRESULT CUInt::Write(IStream* pStream)
l.Write(pStream);
UINT64 val = m_val;
bswap((BYTE*)&val, (int)l);
- return pStream->Write(&val, (ULONG)l, NULL);
+ return pStream->Write(&val, (ULONG)l, nullptr);
}
MatroskaWriter::QWORD CInt::Size(bool fWithHeader)
@@ -243,7 +243,7 @@ HRESULT CInt::Write(IStream* pStream)
l.Write(pStream);
UINT64 val = m_val;
bswap((BYTE*)&val, (int)l);
- return pStream->Write(&val, (ULONG)l, NULL);
+ return pStream->Write(&val, (ULONG)l, nullptr);
}
MatroskaWriter::QWORD CLength::Size(bool fWithHeader)
@@ -268,7 +268,7 @@ HRESULT CLength::Write(IStream* pStream)
UINT64 val = m_len;
bswap((BYTE*)&val, (int)len);
*(BYTE*)&val = ((*(BYTE*)&val) & (1 << (8 - len)) - 1) | (1 << (8 - len));
- return pStream->Write(&val, (ULONG)len, NULL);
+ return pStream->Write(&val, (ULONG)len, nullptr);
}
//
@@ -698,15 +698,15 @@ HRESULT CBlock::Write(IStream* pStream)
TrackNumber.Write(pStream);
short t = (short)TimeCode;
bswap((BYTE*)&t, 2);
- pStream->Write(&t, 2, NULL);
+ pStream->Write(&t, 2, nullptr);
BYTE Lacing = 0;
BYTE n = BlockData.GetCount();
if (n > 1) {
Lacing |= 2;
}
- pStream->Write(&Lacing, 1, NULL);
+ pStream->Write(&Lacing, 1, nullptr);
if (n > 1) {
- pStream->Write(&n, 1, NULL);
+ pStream->Write(&n, 1, nullptr);
POSITION pos = BlockData.GetHeadPosition();
while (pos) {
CBinary* b = BlockData.GetNext(pos);
@@ -714,7 +714,7 @@ HRESULT CBlock::Write(IStream* pStream)
INT_PTR len = b->GetCount();
while (len >= 0) {
n = (BYTE)min(len, 255);
- pStream->Write(&n, 1, NULL);
+ pStream->Write(&n, 1, nullptr);
len -= 255;
}
}
@@ -723,7 +723,7 @@ HRESULT CBlock::Write(IStream* pStream)
POSITION pos = BlockData.GetHeadPosition();
while (pos) {
CBinary* b = BlockData.GetNext(pos);
- pStream->Write(b->GetData(), b->GetCount(), NULL);
+ pStream->Write(b->GetData(), b->GetCount(), nullptr);
}
return S_OK;
}
@@ -923,7 +923,7 @@ HRESULT Void::Write(IStream* pStream)
BYTE buff[64];
memset(buff, 0x80, sizeof(buff));
for (int len = (int)m_len; len > 0; len -= sizeof(buff)) {
- pStream->Write(buff, (ULONG)min(sizeof(buff), len), NULL);
+ pStream->Write(buff, (ULONG)min(sizeof(buff), len), nullptr);
}
return S_OK;
}
diff --git a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
index 8721f0c23..80b3386b4 100644
--- a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
+++ b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
@@ -38,8 +38,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, TRUE, &CLSID_NULL, NULL, 0, NULL},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, TRUE, &CLSID_NULL, nullptr, 0, nullptr},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -47,7 +47,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMatroskaMuxerFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMatroskaMuxerFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -98,7 +98,7 @@ STDMETHODIMP CMatroskaMuxerFilter::NonDelegatingQueryInterface(REFIID riid, void
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
// QI(IAMFilterMiscFlags)
@@ -159,7 +159,7 @@ CBasePin* CMatroskaMuxerFilter::GetPin(int n)
return m_pOutput;
}
- return NULL;
+ return nullptr;
}
STDMETHODIMP CMatroskaMuxerFilter::Stop()
@@ -360,7 +360,7 @@ DWORD CMatroskaMuxerFilter::ThreadProc()
for (;;) {
DWORD cmd = GetRequest();
if (cmd == CMD_EXIT) {
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
}
Reply(S_OK);
if (cmd == CMD_EXIT) {
@@ -418,7 +418,7 @@ DWORD CMatroskaMuxerFilter::ThreadProc()
info.TimeCodeScale.Set(1000000);
info.Duration.Set((float)rtDur / 10000);
struct tm _2001 = {0, 0, 0, 1, 0, 101, 0, 0, 1};
- info.DateUTC.Set((_time64(NULL) - _mktime64(&_2001)) * 1000000000);
+ info.DateUTC.Set((_time64(nullptr) - _mktime64(&_2001)) * 1000000000);
info.Write(pStream);
// Tracks
@@ -475,7 +475,7 @@ DWORD CMatroskaMuxerFilter::ThreadProc()
switch (cmd) {
default:
case CMD_EXIT:
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
Reply(S_OK);
return 0;
@@ -487,14 +487,14 @@ DWORD CMatroskaMuxerFilter::ThreadProc()
INT64 lastcuetimecode = (INT64) - 1;
UINT64 nBlocksInCueTrack = 0;
- while (!CheckRequest(NULL)) {
+ while (!CheckRequest(nullptr)) {
if (m_State == State_Paused) {
Sleep(10);
continue;
}
int nPinsGotSomething = 0, nPinsNeeded = 0;
- CMatroskaMuxerInputPin* pPin = NULL;
+ CMatroskaMuxerInputPin* pPin = nullptr;
REFERENCE_TIME rtMin = _I64_MAX;
pos = pActivePins.GetHeadPosition();
@@ -700,7 +700,7 @@ DWORD CMatroskaMuxerFilter::ThreadProc()
ASSERT(0); // we should only exit via CMD_EXIT
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
return 0;
}
@@ -1215,7 +1215,7 @@ STDMETHODIMP CMatroskaMuxerInputPin::Receive(IMediaSample* pSample)
return hr;
}
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (FAILED(hr = pSample->GetPointer(&pData)) || !pData) {
return hr;
}
diff --git a/src/filters/muxer/WavDest/WavDest.cpp b/src/filters/muxer/WavDest/WavDest.cpp
index 70650f5ad..0426f4872 100644
--- a/src/filters/muxer/WavDest/WavDest.cpp
+++ b/src/filters/muxer/WavDest/WavDest.cpp
@@ -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.
*
@@ -36,8 +36,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -45,7 +45,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {L"WavDest", &__uuidof(CWavDestFilter), CreateInstance<CWavDestFilter>, NULL, &sudFilter[0]}
+ {L"WavDest", &__uuidof(CWavDestFilter), CreateInstance<CWavDestFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
diff --git a/src/filters/parser/AviSplitter/AviFile.cpp b/src/filters/parser/AviSplitter/AviFile.cpp
index e886aedfe..c134b15fc 100644
--- a/src/filters/parser/AviSplitter/AviFile.cpp
+++ b/src/filters/parser/AviSplitter/AviFile.cpp
@@ -258,14 +258,14 @@ HRESULT CAviFile::Parse(DWORD parentid, __int64 end)
if (!strm) {
strm.Attach(DEBUG_NEW strm_t());
}
- ASSERT(strm->indx == NULL);
+ ASSERT(strm->indx == nullptr);
AVISUPERINDEX* pSuperIndex;
if (size < MAXDWORD - 8) {
// Fix buffer overrun vulnerability
try {
pSuperIndex = (AVISUPERINDEX*)DEBUG_NEW unsigned char [(size_t)(size + 8)];
} catch (CMemoryException* e) {
- pSuperIndex = NULL;
+ pSuperIndex = nullptr;
e->Delete();
}
if (pSuperIndex) {
@@ -288,7 +288,7 @@ HRESULT CAviFile::Parse(DWORD parentid, __int64 end)
//if (S_OK != Read(m_vprp)) return E_FAIL;
break;
case FCC('idx1'):
- ASSERT(m_idx1 == NULL);
+ ASSERT(m_idx1 == nullptr);
m_idx1.Attach((AVIOLDINDEX*)DEBUG_NEW BYTE[size + 8]);
m_idx1->fcc = FCC('idx1');
m_idx1->cb = size;
diff --git a/src/filters/parser/AviSplitter/AviSplitter.cpp b/src/filters/parser/AviSplitter/AviSplitter.cpp
index 6cf06fcc8..d8f25c862 100644
--- a/src/filters/parser/AviSplitter/AviSplitter.cpp
+++ b/src/filters/parser/AviSplitter/AviSplitter.cpp
@@ -34,18 +34,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CAviSplitterFilter), AviSplitterName, MERIT_NORMAL + 1, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CAviSourceFilter), AviSourceName, MERIT_NORMAL + 1, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CAviSourceFilter), AviSourceName, MERIT_NORMAL + 1, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAviSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CAviSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAviSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CAviSourceFilter>, nullptr, &sudFilter[1]},
{L"CAviSplitterPropertyPage", &__uuidof(CAviSplitterSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CAviSplitterSettingsWnd>>},
};
@@ -62,7 +62,7 @@ STDAPI DllRegisterServer()
CLSID_AsyncReader,
MEDIASUBTYPE_Avi,
chkbytes,
- _T(".avi"), _T(".divx"), _T(".vp6"), _T(".amv"), NULL);
+ _T(".avi"), _T(".divx"), _T(".vp6"), _T(".amv"), nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -137,7 +137,7 @@ STDMETHODIMP CAviSplitterFilter::NonDelegatingQueryInterface(REFIID riid, void**
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
QI(IAviSplitterFilter)
@@ -282,7 +282,7 @@ HRESULT CAviSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.subtype = FOURCCMap(pwfe->wFormatTag);
}
mt.formattype = FORMAT_WaveFormatEx;
- if (NULL == mt.AllocFormatBuffer(max((ULONG)s->strf.GetCount(), sizeof(WAVEFORMATEX)))) {
+ if (nullptr == mt.AllocFormatBuffer(max((ULONG)s->strf.GetCount(), sizeof(WAVEFORMATEX)))) {
continue;
}
memcpy(mt.Format(), s->strf.GetData(), s->strf.GetCount());
@@ -543,7 +543,7 @@ bool CAviSplitterFilter::DemuxLoop()
fDiscontinuity.SetCount(nTracks);
memset(fDiscontinuity.GetData(), 0, nTracks * sizeof(bool));
- while (SUCCEEDED(hr) && !CheckRequest(NULL)) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr)) {
size_t minTrack = nTracks;
UINT64 minFilePos = _I64_MAX;
@@ -911,7 +911,7 @@ STDMETHODIMP CAviSplitterFilter::GetPages(CAUUID* pPages)
pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CAviSplitterSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -924,14 +924,14 @@ STDMETHODIMP CAviSplitterFilter::CreatePage(const GUID& guid, IPropertyPage** pp
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CAviSplitterSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CAviSplitterSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CAviSplitterSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
diff --git a/src/filters/parser/BaseSplitter/AsyncReader.cpp b/src/filters/parser/BaseSplitter/AsyncReader.cpp
index 73af2b46b..3d4ae990c 100644
--- a/src/filters/parser/BaseSplitter/AsyncReader.cpp
+++ b/src/filters/parser/BaseSplitter/AsyncReader.cpp
@@ -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.
*
@@ -31,9 +31,9 @@
//
CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr)
- : CUnknown(NAME("CAsyncFileReader"), NULL, &hr)
+ : CUnknown(NAME("CAsyncFileReader"), nullptr, &hr)
, m_len((ULONGLONG) - 1)
- , m_hBreakEvent(NULL)
+ , m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = Open(fn, modeRead | shareDenyNone | typeBinary | osSequentialScan) ? S_OK : E_FAIL;
@@ -43,9 +43,9 @@ CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr)
}
CAsyncFileReader::CAsyncFileReader(CAtlList<CHdmvClipInfo::PlaylistItem>& Items, HRESULT& hr)
- : CUnknown(NAME("CAsyncFileReader"), NULL, &hr)
+ : CUnknown(NAME("CAsyncFileReader"), nullptr, &hr)
, m_len((ULONGLONG) - 1)
- , m_hBreakEvent(NULL)
+ , m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = OpenFiles(Items, modeRead | shareDenyNone | typeBinary | osSequentialScan) ? S_OK : E_FAIL;
@@ -177,14 +177,14 @@ STDMETHODIMP CAsyncUrlReader::Length(LONGLONG* pTotal, LONGLONG* pAvailable)
if (pTotal) {
*pTotal = 0;
}
- return __super::Length(NULL, pAvailable);
+ return __super::Length(nullptr, pAvailable);
}
// CAMThread
DWORD CAsyncUrlReader::ThreadProc()
{
- AfxSocketInit(NULL);
+ AfxSocketInit(nullptr);
DWORD cmd = GetRequest();
if (cmd != CMD_INIT) {
@@ -234,7 +234,7 @@ DWORD CAsyncUrlReader::ThreadProc()
//
- m_hThread = NULL;
+ m_hThread = nullptr;
return S_OK;
}
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
index e2b298fed..eac63a4b1 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
@@ -106,7 +106,7 @@ CBaseSplitterInputPin::~CBaseSplitterInputPin()
HRESULT CBaseSplitterInputPin::GetAsyncReader(IAsyncReader** ppAsyncReader)
{
CheckPointer(ppAsyncReader, E_POINTER);
- *ppAsyncReader = NULL;
+ *ppAsyncReader = nullptr;
CheckPointer(m_pAsyncReader, VFW_E_NOT_CONNECTED);
(*ppAsyncReader = m_pAsyncReader)->AddRef();
return S_OK;
@@ -447,7 +447,7 @@ DWORD CBaseSplitterOutputPin::ThreadProc()
bool iHaaliRenderConnect = false;
CComPtr<IPin> pPinTo = this, pTmp;
while (pPinTo && SUCCEEDED(pPinTo->ConnectedTo(&pTmp)) && (pPinTo = pTmp)) {
- pTmp = NULL;
+ pTmp = nullptr;
CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo);
if (GetCLSID(pBF) == CLSID_DXR) { // Haali Renderer
iHaaliRenderConnect = true;
@@ -465,7 +465,7 @@ DWORD CBaseSplitterOutputPin::ThreadProc()
DWORD cmd;
if (CheckRequest(&cmd)) {
- m_hThread = NULL;
+ m_hThread = nullptr;
cmd = GetRequest();
Reply(S_OK);
ASSERT(cmd == CMD_EXIT);
@@ -559,7 +559,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
do {
CComPtr<IMediaSample> pSample;
- if (S_OK != (hr = GetDeliveryBuffer(&pSample, NULL, NULL, 0))) {
+ if (S_OK != (hr = GetDeliveryBuffer(&pSample, nullptr, nullptr, 0))) {
break;
}
@@ -590,7 +590,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
if (S_OK != (hr = m_pAllocator->Commit())) {
break;
}
- if (S_OK != (hr = GetDeliveryBuffer(&pSample, NULL, NULL, 0))) {
+ if (S_OK != (hr = GetDeliveryBuffer(&pSample, nullptr, nullptr, 0))) {
break;
}
}
@@ -615,7 +615,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
ASSERT(!p->bSyncPoint || fTimeValid);
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (S_OK != (hr = pSample->GetPointer(&pData)) || !pData) {
break;
}
@@ -623,10 +623,10 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
if (S_OK != (hr = pSample->SetActualDataLength(nBytes))) {
break;
}
- if (S_OK != (hr = pSample->SetTime(fTimeValid ? &p->rtStart : NULL, fTimeValid ? &p->rtStop : NULL))) {
+ if (S_OK != (hr = pSample->SetTime(fTimeValid ? &p->rtStart : nullptr, fTimeValid ? &p->rtStop : nullptr))) {
break;
}
- if (S_OK != (hr = pSample->SetMediaTime(NULL, NULL))) {
+ if (S_OK != (hr = pSample->SetMediaTime(nullptr, nullptr))) {
break;
}
if (S_OK != (hr = pSample->SetDiscontinuity(p->bDiscontinuity))) {
@@ -650,7 +650,7 @@ void CBaseSplitterOutputPin::MakeISCRHappy()
{
CComPtr<IPin> pPinTo = this, pTmp;
while (pPinTo && SUCCEEDED(pPinTo->ConnectedTo(&pTmp)) && (pPinTo = pTmp)) {
- pTmp = NULL;
+ pTmp = nullptr;
CComPtr<IBaseFilter> pBF = GetFilterFromPin(pPinTo);
@@ -800,7 +800,7 @@ STDMETHODIMP CBaseSplitterFilter::NonDelegatingQueryInterface(REFIID riid, void*
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
if (m_pInput && riid == __uuidof(IFileSourceFilter)) {
return E_NOINTERFACE;
@@ -826,7 +826,7 @@ CBaseSplitterOutputPin* CBaseSplitterFilter::GetOutputPin(DWORD TrackNum)
{
CAutoLock cAutoLock(&m_csPinMap);
- CBaseSplitterOutputPin* pPin = NULL;
+ CBaseSplitterOutputPin* pPin = nullptr;
m_pPinMap.Lookup(TrackNum, pPin);
return pPin;
}
@@ -953,7 +953,7 @@ DWORD CBaseSplitterFilter::ThreadProc()
for (;;) {
DWORD cmd = GetRequest();
if (cmd == CMD_EXIT) {
- CAMThread::m_hThread = NULL;
+ CAMThread::m_hThread = nullptr;
}
Reply(S_OK);
if (cmd == CMD_EXIT) {
@@ -967,7 +967,7 @@ DWORD CBaseSplitterFilter::ThreadProc()
for (DWORD cmd = (DWORD) - 1; ; cmd = GetRequest()) {
if (cmd == CMD_EXIT) {
- m_hThread = NULL;
+ m_hThread = nullptr;
Reply(S_OK);
return 0;
}
@@ -1008,7 +1008,7 @@ DWORD CBaseSplitterFilter::ThreadProc()
ASSERT(0); // we should only exit via CMD_EXIT
- m_hThread = NULL;
+ m_hThread = nullptr;
return 0;
}
@@ -1177,7 +1177,7 @@ CBasePin* CBaseSplitterFilter::GetPin(int n)
return m_pInput;
}
- return NULL;
+ return nullptr;
}
STDMETHODIMP CBaseSplitterFilter::Stop()
@@ -1567,7 +1567,7 @@ STDMETHODIMP CBaseSplitterFilter::GetMarkerTime(long MarkerNum, double* pMarkerT
STDMETHODIMP CBaseSplitterFilter::GetMarkerName(long MarkerNum, BSTR* pbstrMarkerName)
{
- return ChapGet((int)MarkerNum - 1, NULL, pbstrMarkerName);
+ return ChapGet((int)MarkerNum - 1, nullptr, pbstrMarkerName);
}
// IKeyFrameInfo
diff --git a/src/filters/parser/BaseSplitter/MultiFiles.cpp b/src/filters/parser/BaseSplitter/MultiFiles.cpp
index 23e4b7146..1e263c150 100644
--- a/src/filters/parser/BaseSplitter/MultiFiles.cpp
+++ b/src/filters/parser/BaseSplitter/MultiFiles.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2009-2012 see Authors.txt
+ * (C) 2009-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -29,7 +29,7 @@ CMultiFiles::CMultiFiles()
: m_hFile(INVALID_HANDLE_VALUE)
, m_llTotalLength(0)
, m_nCurPart(-1)
- , m_pCurrentPTSOffset(NULL)
+ , m_pCurrentPTSOffset(nullptr)
{
}
@@ -141,7 +141,7 @@ UINT CMultiFiles::Read(void* lpBuf, UINT nCount)
{
DWORD dwRead;
do {
- if (!ReadFile(m_hFile, lpBuf, nCount, &dwRead, NULL)) {
+ if (!ReadFile(m_hFile, lpBuf, nCount, &dwRead, nullptr)) {
break;
}
@@ -175,11 +175,11 @@ BOOL CMultiFiles::OpenPart(int nPart)
ClosePart();
fn = m_strFiles.GetAt(nPart);
- m_hFile = CreateFile(fn, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ m_hFile = CreateFile(fn, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr);
if (m_hFile != INVALID_HANDLE_VALUE) {
m_nCurPart = nPart;
- if (m_pCurrentPTSOffset != NULL) {
+ if (m_pCurrentPTSOffset != nullptr) {
*m_pCurrentPTSOffset = m_rtPtsOffsets[nPart];
}
}
diff --git a/src/filters/parser/DSMSplitter/DSMSplitter.cpp b/src/filters/parser/DSMSplitter/DSMSplitter.cpp
index 3bad482b7..ea9a6f11a 100644
--- a/src/filters/parser/DSMSplitter/DSMSplitter.cpp
+++ b/src/filters/parser/DSMSplitter/DSMSplitter.cpp
@@ -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.
*
@@ -36,18 +36,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CDSMSplitterFilter), DSMSplitterName, MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CDSMSourceFilter), DSMSourceName, MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CDSMSourceFilter), DSMSourceName, MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDSMSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDSMSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDSMSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDSMSourceFilter>, nullptr, &sudFilter[1]},
};
int g_cTemplates = _countof(g_Templates);
@@ -61,7 +61,7 @@ STDAPI DllRegisterServer()
RegisterSourceFilter(
CLSID_AsyncReader,
MEDIASUBTYPE_DirectShowMedia,
- str, NULL);
+ str, nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -225,7 +225,7 @@ bool CDSMSplitterFilter::DemuxLoop()
{
HRESULT hr = S_OK;
- while (SUCCEEDED(hr) && !CheckRequest(NULL) && m_pFile->GetRemaining()) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr) && m_pFile->GetRemaining()) {
dsmp_t type;
UINT64 len;
diff --git a/src/filters/parser/FLVSplitter/FLVSplitter.cpp b/src/filters/parser/FLVSplitter/FLVSplitter.cpp
index 8b3448310..702aca967 100644
--- a/src/filters/parser/FLVSplitter/FLVSplitter.cpp
+++ b/src/filters/parser/FLVSplitter/FLVSplitter.cpp
@@ -64,8 +64,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_MEDIATYPE sudPinTypesOut2[] = {
@@ -74,12 +74,12 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut2[] = {
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CFLVSplitterFilter), FlvSplitterName, MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CFLVSourceFilter), FlvSourceName, MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CFLVSourceFilter), FlvSourceName, MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLVSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CFLVSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLVSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CFLVSourceFilter>, nullptr, &sudFilter[1]},
};
int g_cTemplates = _countof(g_Templates);
@@ -88,7 +88,7 @@ STDAPI DllRegisterServer()
{
DeleteRegKey(_T("Media Type\\Extensions\\"), _T(".flv"));
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_FLV, _T("0,4,,464C5601"), NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_FLV, _T("0,4,,464C5601"), nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -860,7 +860,7 @@ bool CFLVSplitterFilter::DemuxLoop()
AudioTag at = {};
VideoTag vt = {};
- while (SUCCEEDED(hr) && !CheckRequest(NULL) && m_pFile->GetRemaining()) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr) && m_pFile->GetRemaining()) {
if (!ReadTag(t)) {
break;
}
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
index 0bfffbeb2..9570c0488 100644
--- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp
+++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
@@ -49,22 +49,22 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CMP4SplitterFilter), MP4SplitterName, MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CMP4SourceFilter), MP4SourceName, MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CMP4SourceFilter), MP4SourceName, MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
{&__uuidof(CMPEG4VideoSplitterFilter), L"MPC MPEG4 Video Splitter", MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CMPEG4VideoSourceFilter), L"MPC MPEG4 Video Source", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CMPEG4VideoSourceFilter), L"MPC MPEG4 Video Source", MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMP4SplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMP4SourceFilter>, NULL, &sudFilter[1]},
- {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CMPEG4VideoSplitterFilter>, NULL, &sudFilter[2]},
- {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CMPEG4VideoSourceFilter>, NULL, &sudFilter[3]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMP4SplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMP4SourceFilter>, nullptr, &sudFilter[1]},
+ {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CMPEG4VideoSplitterFilter>, nullptr, &sudFilter[2]},
+ {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CMPEG4VideoSourceFilter>, nullptr, &sudFilter[3]},
};
int g_cTemplates = _countof(g_Templates);
@@ -86,7 +86,7 @@ STDAPI DllRegisterServer()
// mpeg4 video
chkbytes.AddTail(_T("3,3,,000001"));
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MP4, chkbytes, NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MP4, chkbytes, nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -523,13 +523,13 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
CMediaType mt;
mt.SetSampleSize(1);
- VIDEOINFOHEADER* vih = NULL;
- WAVEFORMATEX* wfe = NULL;
+ VIDEOINFOHEADER* vih = nullptr;
+ WAVEFORMATEX* wfe = nullptr;
AP4_DataBuffer empty;
if (AP4_SampleDescription* desc = track->GetSampleDescription(sample.GetDescriptionIndex())) {
- AP4_MpegSampleDescription* mpeg_desc = NULL;
+ AP4_MpegSampleDescription* mpeg_desc = nullptr;
if (desc->GetType() == AP4_SampleDescription::TYPE_MPEG) {
mpeg_desc = dynamic_cast<AP4_MpegSampleDescription*>(desc);
@@ -1108,7 +1108,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
static ADPCMCOEFSET coef[] = { {256, 0}, {512, -256}, {0, 0}, {192, 64}, {240, 0}, {460, -208}, {392, -232} };
const ULONG size = sizeof(ADPCMWAVEFORMAT) + (numcoef * sizeof(ADPCMCOEFSET));
ADPCMWAVEFORMAT* format = (ADPCMWAVEFORMAT*)mt.ReallocFormatBuffer(size);
- if (format != NULL) {
+ if (format != nullptr) {
format->wfx.wFormatTag = WAVE_FORMAT_ADPCM;
format->wfx.wBitsPerSample = 4;
format->wfx.cbSize = (WORD)(size - sizeof(WAVEFORMATEX));
@@ -1118,7 +1118,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
}
} else if (type == AP4_ATOM_TYPE('m', 's', 0x00, 0x11)) {
IMAADPCMWAVEFORMAT* format = (IMAADPCMWAVEFORMAT*)mt.ReallocFormatBuffer(sizeof(IMAADPCMWAVEFORMAT));
- if (format != NULL) {
+ if (format != nullptr) {
format->wfx.wFormatTag = WAVE_FORMAT_IMA_ADPCM;
format->wfx.wBitsPerSample = 4;
format->wfx.cbSize = (WORD)(sizeof(IMAADPCMWAVEFORMAT) - sizeof(WAVEFORMATEX));
@@ -1147,7 +1147,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.SetSampleSize(wfe->nBlockAlign);
if (channels > 2 || bitspersample > 16) {
WAVEFORMATEXTENSIBLE* wfex = (WAVEFORMATEXTENSIBLE*)mt.ReallocFormatBuffer(sizeof(WAVEFORMATEXTENSIBLE));
- if (wfex != NULL) {
+ if (wfex != nullptr) {
wfex->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfex->Format.cbSize = 22;
wfex->Samples.wValidBitsPerSample = bitspersample;
@@ -1159,7 +1159,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
mt.SetSampleSize(wfe->nBlockAlign);
if (channels > 2) {
WAVEFORMATEXTENSIBLE* wfex = (WAVEFORMATEXTENSIBLE*)mt.ReallocFormatBuffer(sizeof(WAVEFORMATEXTENSIBLE));
- if (wfex != NULL) {
+ if (wfex != nullptr) {
wfex->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfex->Format.cbSize = 22;
wfex->Samples.wValidBitsPerSample = bitspersample;
@@ -1429,8 +1429,8 @@ bool CMP4SplitterFilter::DemuxLoop()
AP4_Movie* movie = (AP4_Movie*)m_pFile->GetMovie();
- while (SUCCEEDED(hr) && !CheckRequest(NULL)) {
- CAtlMap<DWORD, trackpos>::CPair* pPairNext = NULL;
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr)) {
+ CAtlMap<DWORD, trackpos>::CPair* pPairNext = nullptr;
REFERENCE_TIME rtNext = 0;
POSITION pos = m_trackpos.GetStartPosition();
@@ -2039,7 +2039,7 @@ bool CMPEG4VideoSplitterFilter::DemuxLoop()
DWORD sync = ~0;
- while (SUCCEEDED(hr) && !CheckRequest(NULL) && m_pFile->GetRemaining()) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr) && m_pFile->GetRemaining()) {
for (int i = 0; i < 65536; ++i) { // don't call CheckRequest so often
bool eof = !m_pFile->GetRemaining();
diff --git a/src/filters/parser/MP4Splitter/MP4SplitterFile.cpp b/src/filters/parser/MP4Splitter/MP4SplitterFile.cpp
index fba974a2c..e4881f63b 100644
--- a/src/filters/parser/MP4Splitter/MP4SplitterFile.cpp
+++ b/src/filters/parser/MP4Splitter/MP4SplitterFile.cpp
@@ -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.
*
@@ -25,7 +25,7 @@
CMP4SplitterFile::CMP4SplitterFile(IAsyncReader* pReader, HRESULT& hr)
: CBaseSplitterFileEx(pReader, hr, DEFAULT_CACHE_LENGTH, false)
- , m_pAp4File(NULL)
+ , m_pAp4File(nullptr)
{
if (FAILED(hr)) {
return;
@@ -42,7 +42,7 @@ CMP4SplitterFile::~CMP4SplitterFile()
void* /* AP4_Movie* */ CMP4SplitterFile::GetMovie()
{
ASSERT(m_pAp4File);
- return m_pAp4File ? ((AP4_File*)m_pAp4File)->GetMovie() : NULL;
+ return m_pAp4File ? ((AP4_File*)m_pAp4File)->GetMovie() : nullptr;
}
HRESULT CMP4SplitterFile::Init()
diff --git a/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp b/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp
index 025069fb5..494e1eda2 100644
--- a/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp
+++ b/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp
@@ -296,7 +296,7 @@ ChapterAtom* ChapterAtom::FindChapterAtom(UINT64 id)
}
}
- return NULL;
+ return nullptr;
}
ChapterAtom* Segment::FindChapterAtom(UINT64 id, int nEditionEntry)
@@ -315,7 +315,7 @@ ChapterAtom* Segment::FindChapterAtom(UINT64 id, int nEditionEntry)
}
}
- return NULL;
+ return nullptr;
}
HRESULT Info::Parse(CMatroskaNode* pMN0)
@@ -1038,8 +1038,8 @@ bool CBinary::Compress(ContentCompression& cc)
c_stream.next_in = GetData();
c_stream.avail_in = (uInt)GetCount();
- BYTE* dst = NULL;
- BYTE* newDst = NULL;
+ BYTE* dst = nullptr;
+ BYTE* newDst = nullptr;
int n = 0;
do {
newDst = (BYTE*)realloc(dst, ++n * 10);
@@ -1084,8 +1084,8 @@ bool CBinary::Decompress(ContentCompression& cc)
d_stream.next_in = GetData();
d_stream.avail_in = (uInt)GetCount();
- BYTE* dst = NULL;
- BYTE* newDst = NULL;
+ BYTE* dst = nullptr;
+ BYTE* newDst = nullptr;
int n = 0;
do {
newDst = (BYTE*)realloc(dst, ++n * 1000);
@@ -1387,7 +1387,7 @@ HRESULT CSimpleBlockNode::Parse(CMatroskaNode* pMN, bool fFull)
CMatroskaNode::CMatroskaNode(CMatroskaFile* pMF)
: m_pMF(pMF)
- , m_pParent(NULL)
+ , m_pParent(nullptr)
{
ASSERT(m_pMF);
m_start = m_filepos = 0;
diff --git a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
index f028bbef1..04fda0b6f 100644
--- a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
+++ b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
@@ -40,18 +40,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CMatroskaSplitterFilter), MatroskaSplitterName, MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CMatroskaSourceFilter), MatroskaSourceName, MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CMatroskaSourceFilter), MatroskaSourceName, MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMatroskaSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMatroskaSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMatroskaSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMatroskaSourceFilter>, nullptr, &sudFilter[1]},
};
int g_cTemplates = _countof(g_Templates);
@@ -62,7 +62,7 @@ STDAPI DllRegisterServer()
__uuidof(CMatroskaSourceFilter),
MEDIASUBTYPE_Matroska,
_T("0,4,,1A45DFA3"),
- _T(".mkv"), _T(".mka"), _T(".mks"), NULL);
+ _T(".mkv"), _T(".mka"), _T(".mks"), nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -885,7 +885,7 @@ avcsuccess:
pPinOut.Attach(pinOut[i]);
TrackEntry* pTE = pinOutTE[i];
- if (pTE != NULL) {
+ if (pTE != nullptr) {
AddOutputPin((DWORD)pTE->TrackNumber, pPinOut);
m_pTrackEntryMap[(DWORD)pTE->TrackNumber] = pTE;
m_pOrderedTrackArray.Add(pTE);
@@ -964,7 +964,7 @@ void CMatroskaSplitterFilter::SetupChapters(LPCSTR lng, ChapterAtom* parent, int
while (pos) {
// ChapUID zero not allow by Matroska specs
UINT64 ChapUID = parent->ChapterAtoms.GetNext(pos)->ChapterUID;
- ChapterAtom* ca = (ChapUID == 0) ? NULL : m_pFile->m_segment.FindChapterAtom(ChapUID);
+ ChapterAtom* ca = (ChapUID == 0) ? nullptr : m_pFile->m_segment.FindChapterAtom(ChapUID);
if (ca) {
CStringW name, first;
@@ -1030,7 +1030,7 @@ void CMatroskaSplitterFilter::SendVorbisHeaderSample()
POSITION pos = m_pTrackEntryMap.GetStartPosition();
while (pos) {
DWORD TrackNumber = 0;
- TrackEntry* pTE = NULL;
+ TrackEntry* pTE = nullptr;
m_pTrackEntryMap.GetNextAssoc(pos, TrackNumber, pTE);
CBaseSplitterOutputPin* pPin = GetOutputPin(TrackNumber);
@@ -1233,7 +1233,7 @@ void CMatroskaSplitterFilter::DemuxSeek(REFERENCE_TIME rt)
}
if (fFoundKeyFrame) {
- pos1 = pos2 = pos3 = NULL;
+ pos1 = pos2 = pos3 = nullptr;
}
}
}
@@ -1283,7 +1283,7 @@ bool CMatroskaSplitterFilter::DemuxLoop()
p->bSyncPoint = !p->bg->ReferenceBlock.IsValid();
p->TrackNumber = (DWORD)p->bg->Block.TrackNumber;
- TrackEntry* pTE = NULL;
+ TrackEntry* pTE = nullptr;
if (!m_pTrackEntryMap.Lookup(p->TrackNumber, pTE) || !pTE) {
continue;
@@ -1310,11 +1310,11 @@ bool CMatroskaSplitterFilter::DemuxLoop()
hr = DeliverPacket(p);
}
- } while (m_pBlock->NextBlock() && SUCCEEDED(hr) && !CheckRequest(NULL));
+ } while (m_pBlock->NextBlock() && SUCCEEDED(hr) && !CheckRequest(nullptr));
m_pBlock.Free();
} while (m_pFile->GetPos() < (__int64)(m_pFile->m_segment.pos + m_pFile->m_segment.len)
- && m_pCluster->Next(true) && SUCCEEDED(hr) && !CheckRequest(NULL));
+ && m_pCluster->Next(true) && SUCCEEDED(hr) && !CheckRequest(nullptr));
m_pCluster.Free();
@@ -1466,7 +1466,7 @@ HRESULT CMatroskaSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
m_rob.InsertAfter(pos, mp);
}
- mp = NULL;
+ mp = nullptr;
if (m_rob.GetCount() == m_nMinCache + 1) {
ASSERT(m_nMinCache > 0);
@@ -1574,7 +1574,7 @@ HRESULT CMatroskaSplitterOutputPin::DeliverBlock(MatroskaPacket* p)
TrackEntry* CMatroskaSplitterFilter::GetTrackEntryAt(UINT aTrackIdx)
{
if (aTrackIdx >= m_pOrderedTrackArray.GetCount()) {
- return NULL;
+ return nullptr;
}
return m_pOrderedTrackArray[aTrackIdx];
}
@@ -1587,7 +1587,7 @@ STDMETHODIMP_(UINT) CMatroskaSplitterFilter::GetTrackCount()
STDMETHODIMP_(BOOL) CMatroskaSplitterFilter::GetTrackInfo(UINT aTrackIdx, struct TrackElement* pStructureToFill)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
+ if (pTE == nullptr) {
return FALSE;
}
@@ -1608,7 +1608,7 @@ STDMETHODIMP_(BOOL) CMatroskaSplitterFilter::GetTrackInfo(UINT aTrackIdx, struct
STDMETHODIMP_(BOOL) CMatroskaSplitterFilter::GetTrackExtendedInfo(UINT aTrackIdx, void* pStructureToFill)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
+ if (pTE == nullptr) {
return FALSE;
}
@@ -1637,8 +1637,8 @@ STDMETHODIMP_(BOOL) CMatroskaSplitterFilter::GetTrackExtendedInfo(UINT aTrackIdx
STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackName(UINT aTrackIdx)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
- return NULL;
+ if (pTE == nullptr) {
+ return nullptr;
}
return pTE->Name.AllocSysString();
}
@@ -1646,8 +1646,8 @@ STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackName(UINT aTrackIdx)
STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecID(UINT aTrackIdx)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
- return NULL;
+ if (pTE == nullptr) {
+ return nullptr;
}
return pTE->CodecID.ToString().AllocSysString();
}
@@ -1655,8 +1655,8 @@ STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecID(UINT aTrackIdx)
STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecName(UINT aTrackIdx)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
- return NULL;
+ if (pTE == nullptr) {
+ return nullptr;
}
return pTE->CodecName.AllocSysString();
}
@@ -1664,8 +1664,8 @@ STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecName(UINT aTrackIdx)
STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecInfoURL(UINT aTrackIdx)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
- return NULL;
+ if (pTE == nullptr) {
+ return nullptr;
}
return pTE->CodecInfoURL.AllocSysString();
}
@@ -1673,8 +1673,8 @@ STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecInfoURL(UINT aTrackIdx
STDMETHODIMP_(BSTR) CMatroskaSplitterFilter::GetTrackCodecDownloadURL(UINT aTrackIdx)
{
TrackEntry* pTE = GetTrackEntryAt(aTrackIdx);
- if (pTE == NULL) {
- return NULL;
+ if (pTE == nullptr) {
+ return nullptr;
}
return pTE->CodecDownloadURL.AllocSysString();
}
diff --git a/src/filters/parser/MpaSplitter/MpaSplitter.cpp b/src/filters/parser/MpaSplitter/MpaSplitter.cpp
index 24406959b..d310a7d09 100644
--- a/src/filters/parser/MpaSplitter/MpaSplitter.cpp
+++ b/src/filters/parser/MpaSplitter/MpaSplitter.cpp
@@ -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.
*
@@ -35,18 +35,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CMpaSplitterFilter), MpaSplitterName, MERIT_NORMAL + 1, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CMpaSourceFilter), MpaSourceName, MERIT_NORMAL + 1, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CMpaSourceFilter), MpaSourceName, MERIT_NORMAL + 1, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpaSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMpaSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpaSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMpaSourceFilter>, nullptr, &sudFilter[1]},
};
int g_cTemplates = _countof(g_Templates);
@@ -56,7 +56,7 @@ STDAPI DllRegisterServer()
CAtlList<CString> chkbytes;
chkbytes.AddTail(_T("0,2,FFE0,FFE0"));
chkbytes.AddTail(_T("0,10,FFFFFF00000080808080,49443300000000000000"));
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG1Audio, chkbytes, NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG1Audio, chkbytes, nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -200,7 +200,7 @@ bool CMpaSplitterFilter::DemuxLoop()
int FrameSize;
REFERENCE_TIME rtDuration;
- while (SUCCEEDED(hr) && !CheckRequest(NULL) && m_pFile->GetPos() < m_pFile->GetEndPos() - 9) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr) && m_pFile->GetPos() < m_pFile->GetEndPos() - 9) {
if (!m_pFile->Sync(FrameSize, rtDuration)) {
Sleep(1);
continue;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
index 7fba2a8fc..2b2203068 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
@@ -72,18 +72,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL},
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr},
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CMpegSplitterFilter), MpegSplitterName, MERIT_NORMAL + 1, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CMpegSourceFilter), MpegSourceName, MERIT_UNLIKELY, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CMpegSourceFilter), MpegSourceName, MERIT_UNLIKELY, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpegSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMpegSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpegSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CMpegSourceFilter>, nullptr, &sudFilter[1]},
{L"CMpegSplitterPropertyPage", &__uuidof(CMpegSplitterSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpegSplitterSettingsWnd>>},
};
@@ -93,15 +93,15 @@ STDAPI DllRegisterServer()
{
DeleteRegKey(_T("Media Type\\Extensions\\"), _T(".ts"));
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG1System, _T("0,16,FFFFFFFFF100010001800001FFFFFFFF,000001BA2100010001800001000001BB"), NULL);
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_PROGRAM, _T("0,5,FFFFFFFFC0,000001BA40"), NULL);
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_PVA, _T("0,8,fffffc00ffe00000,4156000055000000"), NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG1System, _T("0,16,FFFFFFFFF100010001800001FFFFFFFF,000001BA2100010001800001000001BB"), nullptr);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_PROGRAM, _T("0,5,FFFFFFFFC0,000001BA40"), nullptr);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_PVA, _T("0,8,fffffc00ffe00000,4156000055000000"), nullptr);
CAtlList<CString> chkbytes;
chkbytes.AddTail(_T("0,1,,47,188,1,,47,376,1,,47"));
chkbytes.AddTail(_T("4,1,,47,196,1,,47,388,1,,47"));
chkbytes.AddTail(_T("0,4,,54467263,1660,1,,47")); // TFrc
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_TRANSPORT, chkbytes, NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_MPEG2_TRANSPORT, chkbytes, nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -163,7 +163,7 @@ CString FormatString(const wchar_t* pszFormat, ...)
CString GetMediaTypeDesc(const CMediaType* _pMediaType, const CHdmvClipInfo::Stream* pClipInfo, int _PresentationType, CString lang)
{
- const WCHAR* pPresentationDesc = NULL;
+ const WCHAR* pPresentationDesc = nullptr;
if (pClipInfo) {
pPresentationDesc = StreamTypeToName(pClipInfo->m_Type);
@@ -189,8 +189,8 @@ CString GetMediaTypeDesc(const CMediaType* _pMediaType, const CHdmvClipInfo::Str
}
}
- const VIDEOINFOHEADER* pVideoInfo = NULL;
- const VIDEOINFOHEADER2* pVideoInfo2 = NULL;
+ const VIDEOINFOHEADER* pVideoInfo = nullptr;
+ const VIDEOINFOHEADER2* pVideoInfo2 = nullptr;
if (_pMediaType->formattype == FORMAT_MPEGVideo) {
Infos.AddTail(L"MPEG");
@@ -856,7 +856,7 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
int iProgram = -1;
const CHdmvClipInfo::Stream* pClipInfo;
const CMpegSplitterFile::program* pProgram = m_pFile->FindProgram(s.pid, iProgram, pClipInfo);
- const wchar_t* pStreamName = NULL;
+ const wchar_t* pStreamName = nullptr;
int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
@@ -943,7 +943,7 @@ HRESULT CMpegSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
int iProgram = -1;
const CHdmvClipInfo::Stream* pClipInfo;
const CMpegSplitterFile::program* pProgram = m_pFile->FindProgram(s.pid, iProgram, pClipInfo);
- const wchar_t* pStreamName = NULL;
+ const wchar_t* pStreamName = nullptr;
int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
@@ -1107,7 +1107,7 @@ bool CMpegSplitterFilter::DemuxLoop()
REFERENCE_TIME rtStartOffset = m_rtStartOffset ? m_rtStartOffset : m_pFile->m_rtMin;
HRESULT hr = S_OK;
- while (SUCCEEDED(hr) && !CheckRequest(NULL)) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr)) {
if ((hr = m_pFile->HasMoreData(1024 * 500)) == S_OK)
if ((hr = DemuxNextPacket(rtStartOffset)) == S_FALSE) {
Sleep(1);
@@ -1185,7 +1185,7 @@ STDMETHODIMP CMpegSplitterFilter::Enable(long lIndex, DWORD dwFlags)
const CHdmvClipInfo::Stream* pClipInfo;
const CMpegSplitterFile::program* p = m_pFile->FindProgram(to.pid, iProgram, pClipInfo);
- if (p != NULL && !m_ClipInfo.IsHdmv() && !m_pFile->IsHdmv()) {
+ if (p != nullptr && !m_ClipInfo.IsHdmv() && !m_pFile->IsHdmv()) {
for (int k = 0; k < _countof(m_pFile->m_streams); k++) {
if (k == i) {
continue;
@@ -1318,10 +1318,10 @@ STDMETHODIMP CMpegSplitterFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
*pdwGroup = i;
}
if (ppObject) {
- *ppObject = NULL;
+ *ppObject = nullptr;
}
if (ppUnk) {
- *ppUnk = NULL;
+ *ppUnk = nullptr;
}
if (ppszName) {
@@ -1338,7 +1338,7 @@ STDMETHODIMP CMpegSplitterFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
int iProgram;
const CHdmvClipInfo::Stream* pClipInfo;
const CMpegSplitterFile::program* pProgram = m_pFile->FindProgram(s.pid, iProgram, pClipInfo);
- const wchar_t* pStreamName = NULL;
+ const wchar_t* pStreamName = nullptr;
int StreamType = pClipInfo ? pClipInfo->m_Type : pProgram ? pProgram->streams[iProgram].type : 0;
pStreamName = StreamTypeToName((PES_STREAM_TYPE)StreamType);
@@ -1359,7 +1359,7 @@ STDMETHODIMP CMpegSplitterFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
}
*ppszName = (WCHAR*)CoTaskMemAlloc((str.GetLength() + 1) * sizeof(WCHAR));
- if (*ppszName == NULL) {
+ if (*ppszName == nullptr) {
return E_OUTOFMEMORY;
}
@@ -1383,7 +1383,7 @@ STDMETHODIMP CMpegSplitterFilter::GetPages(CAUUID* pPages)
pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpegSplitterSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -1396,14 +1396,14 @@ STDMETHODIMP CMpegSplitterFilter::CreatePage(const GUID& guid, IPropertyPage** p
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpegSplitterSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpegSplitterSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpegSplitterSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -1678,7 +1678,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
p2->rtStop = m_p->rtStop;
m_p->rtStop = Packet::INVALID_TIME;
p2->pmt = m_p->pmt;
- m_p->pmt = NULL;
+ m_p->pmt = nullptr;
p2->SetData(s, len);
s += len;
@@ -1706,7 +1706,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
}
m_p->pmt = p->pmt;
- p->pmt = NULL;
+ p->pmt = nullptr;
}
return S_OK;
@@ -1763,7 +1763,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
memcpy(p3->GetData(), &dwNalLength, sizeof(dwNalLength));
memcpy(p3->GetData() + sizeof(dwNalLength), Nalu.GetDataBuffer(), Nalu.GetDataLength());
- if (p2 == NULL) {
+ if (p2 == nullptr) {
p2 = p3;
} else {
p2->Append(*p3);
@@ -1788,7 +1788,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
m_p->rtStop = Packet::INVALID_TIME;
p2->pmt = m_p->pmt;
- m_p->pmt = NULL;
+ m_p->pmt = nullptr;
m_pl.AddTail(p2);
@@ -1810,7 +1810,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
}
m_p->pmt = p->pmt;
- p->pmt = NULL;
+ p->pmt = nullptr;
}
if (start > m_p->GetData()) {
m_p->RemoveAt(0, start - m_p->GetData());
@@ -1925,7 +1925,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
m_p->rtStop = Packet::INVALID_TIME;
p2->pmt = m_p->pmt;
- m_p->pmt = NULL;
+ m_p->pmt = nullptr;
p2->SetData(start, next - start);
@@ -1952,7 +1952,7 @@ HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
}
m_p->pmt = p->pmt;
- p->pmt = NULL;
+ p->pmt = nullptr;
start = next;
bSeqFound = (*(DWORD*)start == 0x0D010000);
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
index a1adacbc9..f2fceec5b 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp
@@ -690,7 +690,7 @@ DWORD CMpegSplitterFile::AddStream(WORD pid, BYTE pesid, BYTE ps1id, DWORD len)
int iProgram;
const CHdmvClipInfo::Stream* pClipInfo;
const program* pProgram = FindProgram(s.pid, iProgram, pClipInfo);
- if ((type == unknown) && (pProgram != NULL)) {
+ if ((type == unknown) && (pProgram != nullptr)) {
PES_STREAM_TYPE StreamType = INVALID;
Seek(start);
@@ -706,7 +706,7 @@ DWORD CMpegSplitterFile::AddStream(WORD pid, BYTE pesid, BYTE ps1id, DWORD len)
break;
case PRESENTATION_GRAPHICS_STREAM: {
CMpegSplitterFile::hdmvsubhdr h;
- if (!m_streams[subpic].Find(s) && Read(h, &s.mt, pClipInfo ? pClipInfo->m_LanguageCode : NULL)) {
+ if (!m_streams[subpic].Find(s) && Read(h, &s.mt, pClipInfo ? pClipInfo->m_LanguageCode : nullptr)) {
m_bIsHdmv = true;
type = subpic;
}
@@ -718,7 +718,7 @@ DWORD CMpegSplitterFile::AddStream(WORD pid, BYTE pesid, BYTE ps1id, DWORD len)
int iProgram;
const CHdmvClipInfo::Stream* pClipInfo;
const program* pProgram = FindProgram(s.pid, iProgram, pClipInfo);
- if ((type == unknown) && (pProgram != NULL) && AUDIO_STREAM_AC3_TRUE_HD == pProgram->streams[iProgram].type) {
+ if ((type == unknown) && (pProgram != nullptr) && AUDIO_STREAM_AC3_TRUE_HD == pProgram->streams[iProgram].type) {
const stream* source = m_streams[audio].FindStream(s.pid);
if (source && source->mt.subtype == MEDIASUBTYPE_DOLBY_AC3) {
CMpegSplitterFile::ac3hdr h;
@@ -911,7 +911,7 @@ CAtlList<CMpegSplitterFile::stream>* CMpegSplitterFile::GetMasterStream()
#if defined(MVC_SUPPORT)
!m_streams[stereo].IsEmpty() ? &m_streams[stereo] :
#endif
- NULL;
+ nullptr;
}
void CMpegSplitterFile::UpdatePrograms(const tshdr& h, bool UpdateLang)
@@ -1025,7 +1025,7 @@ void CMpegSplitterFile::UpdatePrograms(CGolombBuffer gb, WORD pid, bool UpdateLa
stream s;
s.pid = pid;
CMpegSplitterFile::hdmvsubhdr hdr;
- if (Read(hdr, &s.mt, NULL)) {
+ if (Read(hdr, &s.mt, nullptr)) {
if (!m_streams[subpic].Find(s)) {
m_streams[subpic].Insert(s, this);
}
@@ -1114,7 +1114,7 @@ const CMpegSplitterFile::program* CMpegSplitterFile::FindProgram(WORD pid, int&
}
}
- return NULL;
+ return nullptr;
}
bool CMpegSplitterFile::GetStreamType(WORD pid, PES_STREAM_TYPE& stream_type)
diff --git a/src/filters/parser/OggSplitter/OggSplitter.cpp b/src/filters/parser/OggSplitter/OggSplitter.cpp
index 1c9a55433..d4ea61387 100644
--- a/src/filters/parser/OggSplitter/OggSplitter.cpp
+++ b/src/filters/parser/OggSplitter/OggSplitter.cpp
@@ -41,18 +41,18 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(COggSplitterFilter), OggSplitterName, MERIT_NORMAL + 1, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(COggSourceFilter), OggSourceName, MERIT_NORMAL + 1, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(COggSourceFilter), OggSourceName, MERIT_NORMAL + 1, 0, nullptr, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<COggSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<COggSourceFilter>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<COggSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<COggSourceFilter>, nullptr, &sudFilter[1]},
};
int g_cTemplates = _countof(g_Templates);
@@ -63,7 +63,7 @@ STDAPI DllRegisterServer()
CLSID_AsyncReader,
MEDIASUBTYPE_Ogg,
_T("0,4,,4F676753"), // OggS
- _T(".ogg"), _T(".ogm"), NULL);
+ _T(".ogg"), _T(".ogm"), nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -557,7 +557,7 @@ bool COggSplitterFilter::DemuxLoop()
HRESULT hr = S_OK;
OggPage page;
- while (SUCCEEDED(hr) && !CheckRequest(NULL) && m_pFile->Read(page, true, GetRequestHandle())) {
+ while (SUCCEEDED(hr) && !CheckRequest(nullptr) && m_pFile->Read(page, true, GetRequestHandle())) {
COggSplitterOutputPin* pOggPin = dynamic_cast<COggSplitterOutputPin*>(GetOutputPin(page.m_hdr.bitstream_serial_number));
if (!pOggPin) {
ASSERT(0);
@@ -571,7 +571,7 @@ bool COggSplitterFilter::DemuxLoop()
break;
}
CAutoPtr<OggPacket> p;
- while (!CheckRequest(NULL) && SUCCEEDED(hr) && (p = pOggPin->GetPacket())) {
+ while (!CheckRequest(nullptr) && SUCCEEDED(hr) && (p = pOggPin->GetPacket())) {
if (!p->fSkip) {
hr = DeliverPacket(p);
}
@@ -1191,7 +1191,7 @@ COggAudioOutputPin::COggAudioOutputPin(OggStreamHeader* h, LPCWSTR pName, CBaseF
CMediaType mt;
mt.majortype = MEDIATYPE_Audio;
- mt.subtype = FOURCCMap(strtol(CStringA(h->subtype, 4), NULL, 16));
+ mt.subtype = FOURCCMap(strtol(CStringA(h->subtype, 4), nullptr, 16));
mt.formattype = FORMAT_WaveFormatEx;
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.AllocFormatBuffer(sizeof(WAVEFORMATEX) + extra);
memset(mt.Format(), 0, mt.FormatLength());
diff --git a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
index a59215e77..1b5a3a2af 100644
--- a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
+++ b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
@@ -103,8 +103,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, 0, NULL}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, 0, nullptr}
};
const AMOVIESETUP_MEDIATYPE sudPinTypesIn2[] = {
@@ -119,8 +119,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut2[] = {
};
const AMOVIESETUP_PIN sudpPins2[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn2), sudPinTypesIn2},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut2), sudPinTypesOut2}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn2), sudPinTypesIn2},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut2), sudPinTypesOut2}
};
const AMOVIESETUP_MEDIATYPE sudPinTypesIn3[] = {
@@ -140,29 +140,29 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut3[] = {
};
const AMOVIESETUP_PIN sudpPins3[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn3), sudPinTypesIn3},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut3), sudPinTypesOut3}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn3), sudPinTypesIn3},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut3), sudPinTypesOut3}
};
const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CRealMediaSplitterFilter), RMSplitterName, MERIT_NORMAL, _countof(sudpPins), sudpPins, CLSID_LegacyAmFilterCategory},
- {&__uuidof(CRealMediaSourceFilter), RMSourceName, MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory},
+ {&__uuidof(CRealMediaSourceFilter), RMSourceName, MERIT_NORMAL, 0, nullptr, CLSID_LegacyAmFilterCategory},
{&__uuidof(CRealVideoDecoder), L"MPC RealVideo Decoder", MERIT_NORMAL, _countof(sudpPins2), sudpPins2, CLSID_LegacyAmFilterCategory},
{&__uuidof(CRealAudioDecoder), L"MPC RealAudio Decoder", MERIT_NORMAL, _countof(sudpPins3), sudpPins3, CLSID_LegacyAmFilterCategory},
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CRealMediaSplitterFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CRealMediaSourceFilter>, NULL, &sudFilter[1]},
- {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CRealVideoDecoder>, NULL, &sudFilter[2]},
- {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CRealAudioDecoder>, NULL, &sudFilter[3]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CRealMediaSplitterFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CRealMediaSourceFilter>, nullptr, &sudFilter[1]},
+ {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CRealVideoDecoder>, nullptr, &sudFilter[2]},
+ {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CRealAudioDecoder>, nullptr, &sudFilter[3]},
};
int g_cTemplates = _countof(g_Templates);
STDAPI DllRegisterServer()
{
- RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_RealMedia, _T("0,4,,2E524D46"), _T(".rm"), _T(".rmvb"), _T(".ram"), NULL);
+ RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_RealMedia, _T("0,4,,2E524D46"), _T(".rm"), _T(".rmvb"), _T(".ram"), nullptr);
return AMovieDllRegisterServer2(TRUE);
}
@@ -332,7 +332,7 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
}
}
- BYTE* extra = NULL;
+ BYTE* extra = nullptr;
WORD ver = fmt[4] << 8 | fmt[5];
if (ver == 3) {
@@ -490,7 +490,7 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
int n = 0;
if (key.Find("CHAPTER") == 0 && key.Find("TIME") == key.GetLength() - 4
- && (n = strtol(key.Mid(7), NULL, 10)) > 0) {
+ && (n = strtol(key.Mid(7), nullptr, 10)) > 0) {
int h, m, s, ms;
char c;
if (7 != sscanf_s(value, "%d%c%d%c%d%c%d", &h, &c, 1, &m, &c, 1, &s, &c, 1, &ms)) {
@@ -626,7 +626,7 @@ bool CRealMediaSplitterFilter::DemuxInit()
m_fAbort = false;
}
- m_seekpos = NULL;
+ m_seekpos = nullptr;
m_seekpacket = 0;
m_seekfilepos = 0;
@@ -640,7 +640,7 @@ void CRealMediaSplitterFilter::DemuxSeek(REFERENCE_TIME rt)
m_seekpacket = 0;
m_seekfilepos = m_pFile->m_dcs.GetHead()->pos;
} else {
- m_seekpos = NULL;
+ m_seekpos = nullptr;
POSITION pos = m_pFile->m_irs.GetTailPosition();
while (pos && !m_seekpos) {
@@ -716,7 +716,7 @@ bool CRealMediaSplitterFilter::DemuxLoop()
POSITION pos;
pos = m_pFile->m_subs.GetHeadPosition();
- for (DWORD stream = 0; pos && SUCCEEDED(hr) && !CheckRequest(NULL); stream++) {
+ for (DWORD stream = 0; pos && SUCCEEDED(hr) && !CheckRequest(nullptr); stream++) {
CRMFile::subtitle& s = m_pFile->m_subs.GetNext(pos);
CAutoPtr<Packet> p(DEBUG_NEW Packet);
@@ -754,12 +754,12 @@ bool CRealMediaSplitterFilter::DemuxLoop()
}
pos = m_seekpos;
- while (pos && SUCCEEDED(hr) && !CheckRequest(NULL)) {
+ while (pos && SUCCEEDED(hr) && !CheckRequest(nullptr)) {
DataChunk* pdc = m_pFile->m_dcs.GetNext(pos);
m_pFile->Seek(m_seekfilepos > 0 ? m_seekfilepos : pdc->pos);
- for (UINT32 i = m_seekpacket; i < pdc->nPackets && SUCCEEDED(hr) && !CheckRequest(NULL); i++) {
+ for (UINT32 i = m_seekpacket; i < pdc->nPackets && SUCCEEDED(hr) && !CheckRequest(nullptr); i++) {
MediaPacketHeader mph;
if (S_OK != (hr = m_pFile->Read(mph))) {
break;
@@ -1355,7 +1355,7 @@ HRESULT CRMFile::Init()
p += s.name.GetLength() + 1;
CStringA len(p);
p += len.GetLength() + 1;
- s.data = CStringA(p, strtol(len, NULL, 10));
+ s.data = CStringA(p, strtol(len, nullptr, 10));
p += s.data.GetLength();
m_subs.AddTail(s);
}
@@ -1637,7 +1637,7 @@ int CRMFile::GetMasterStream()
CRealVideoDecoder::CRealVideoDecoder(LPUNKNOWN lpunk, HRESULT* phr)
: CBaseVideoFilter(NAME("CRealVideoDecoder"), lpunk, phr, __uuidof(this))
- , m_hDrvDll(NULL)
+ , m_hDrvDll(nullptr)
, m_dwCookie(0)
, m_lastBuffSizeDim(0)
{
@@ -1708,7 +1708,7 @@ HRESULT CRealVideoDecoder::Transform(IMediaSample* pIn)
HRESULT hr;
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -1796,14 +1796,14 @@ HRESULT CRealVideoDecoder::Transform(IMediaSample* pIn)
}
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (/*FAILED(hr = GetDeliveryBuffer(transform_out.w, transform_out.h, &pOut)) // TODO
&& */ FAILED(hr = GetDeliveryBuffer(m_w, m_h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
}
- BYTE* pI420[3] = {m_pI420, m_pI420Tmp, NULL};
+ BYTE* pI420[3] = {m_pI420, m_pI420Tmp, nullptr};
if (interlaced) {
int iSize = m_w * m_h;
@@ -1823,7 +1823,7 @@ HRESULT CRealVideoDecoder::Transform(IMediaSample* pIn)
rtStart = 10000i64 * transform_out.timestamp - m_tStart;
rtStop = rtStart + 1;
- pOut->SetTime(&rtStart, /*NULL*/&rtStop);
+ pOut->SetTime(&rtStart, /*nullptr*/&rtStop);
pOut->SetDiscontinuity(pIn->IsDiscontinuity() == S_OK);
@@ -1934,7 +1934,7 @@ HRESULT CRealVideoDecoder::CheckInputType(const CMediaType* mtIn)
if (!m_pInput->IsConnected()) {
if (m_hDrvDll) {
FreeLibrary(m_hDrvDll);
- m_hDrvDll = NULL;
+ m_hDrvDll = nullptr;
}
CAtlList<CString> paths;
@@ -1950,7 +1950,7 @@ HRESULT CRealVideoDecoder::CheckInputType(const CMediaType* mtIn)
TCHAR buff[MAX_PATH];
ULONG len = sizeof(buff);
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Software\\RealNetworks\\Preferences\\DT_Codecs"), KEY_READ)
- && ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0) {
+ && ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && _tcslen(buff) > 0) {
oldpath = buff;
TCHAR c = oldpath[oldpath.GetLength() - 1];
if (c != '\\' && c != '/') {
@@ -1960,7 +1960,7 @@ HRESULT CRealVideoDecoder::CheckInputType(const CMediaType* mtIn)
}
len = sizeof(buff);
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Helix\\HelixSDK\\10.0\\Preferences\\DT_Codecs"), KEY_READ)
- && ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0) {
+ && ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && _tcslen(buff) > 0) {
newpath = buff;
TCHAR c = newpath[newpath.GetLength() - 1];
if (c != '\\' && c != '/') {
@@ -2105,7 +2105,7 @@ HRESULT CRealVideoDecoder::AlterQuality(Quality q)
CRealAudioDecoder::CRealAudioDecoder(LPUNKNOWN lpunk, HRESULT* phr)
: CTransformFilter(NAME("CRealAudioDecoder"), lpunk, __uuidof(this))
- , m_hDrvDll(NULL)
+ , m_hDrvDll(nullptr)
, m_dwCookie(0)
{
if (phr) {
@@ -2156,7 +2156,7 @@ HRESULT CRealAudioDecoder::InitRA(const CMediaType* pmt)
void* extra;
} initdata = {
pwfe->nSamplesPerSec, wBitsPerSample, pwfe->nChannels, 100,
- 0, 0, 0, NULL
+ 0, 0, 0, nullptr
};
#pragma pack(pop)
@@ -2245,7 +2245,7 @@ HRESULT CRealAudioDecoder::Receive(IMediaSample* pIn)
return m_pOutput->Deliver(pIn);
}
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -2270,8 +2270,8 @@ HRESULT CRealAudioDecoder::Receive(IMediaSample* pIn)
m_fBuffDiscontinuity = pIn->IsDiscontinuity() == S_OK;
}
- BYTE* src = NULL;
- BYTE* dst = NULL;
+ BYTE* src = nullptr;
+ BYTE* dst = nullptr;
int w = m_rai.coded_frame_size;
int h = m_rai.sub_packet_h;
@@ -2351,8 +2351,8 @@ HRESULT CRealAudioDecoder::Receive(IMediaSample* pIn)
for (; src < dst; src += w) {
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
- if (FAILED(hr = m_pOutput->GetDeliveryBuffer(&pOut, NULL, NULL, 0))
+ BYTE* pDataOut = nullptr;
+ if (FAILED(hr = m_pOutput->GetDeliveryBuffer(&pOut, nullptr, nullptr, 0))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
}
@@ -2376,7 +2376,7 @@ HRESULT CRealAudioDecoder::Receive(IMediaSample* pIn)
rtStop = rtStart + 1000i64 * len / pwfe->nAvgBytesPerSec * 10000;
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetDiscontinuity(m_fBuffDiscontinuity);
m_fBuffDiscontinuity = false;
@@ -2417,7 +2417,7 @@ HRESULT CRealAudioDecoder::CheckInputType(const CMediaType* mtIn)
if (!m_pInput->IsConnected()) {
if (m_hDrvDll) {
FreeLibrary(m_hDrvDll);
- m_hDrvDll = NULL;
+ m_hDrvDll = nullptr;
}
CAtlList<CString> paths;
@@ -2442,7 +2442,7 @@ HRESULT CRealAudioDecoder::CheckInputType(const CMediaType* mtIn)
TCHAR buff[MAX_PATH];
ULONG len = _countof(buff);
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Software\\RealNetworks\\Preferences\\DT_Codecs"), KEY_READ)
- && ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0) {
+ && ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && _tcslen(buff) > 0) {
oldpath = buff;
TCHAR c = oldpath[oldpath.GetLength() - 1];
if (c != '\\' && c != '/') {
@@ -2452,7 +2452,7 @@ HRESULT CRealAudioDecoder::CheckInputType(const CMediaType* mtIn)
}
len = _countof(buff);
if (ERROR_SUCCESS == key.Open(HKEY_CLASSES_ROOT, _T("Helix\\HelixSDK\\10.0\\Preferences\\DT_Codecs"), KEY_READ)
- && ERROR_SUCCESS == key.QueryStringValue(NULL, buff, &len) && _tcslen(buff) > 0) {
+ && ERROR_SUCCESS == key.QueryStringValue(nullptr, buff, &len) && _tcslen(buff) > 0) {
newpath = buff;
TCHAR c = newpath[newpath.GetLength() - 1];
if (c != '\\' && c != '/') {
diff --git a/src/filters/parser/StreamDriveThru/StreamDriveThru.cpp b/src/filters/parser/StreamDriveThru/StreamDriveThru.cpp
index 5f317c0cc..3cf4c3964 100644
--- a/src/filters/parser/StreamDriveThru/StreamDriveThru.cpp
+++ b/src/filters/parser/StreamDriveThru/StreamDriveThru.cpp
@@ -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.
*
@@ -34,8 +34,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -43,7 +43,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CStreamDriveThruFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CStreamDriveThruFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -135,7 +135,7 @@ DWORD CStreamDriveThruFilter::ThreadProc()
LARGE_INTEGER li = {0};
ULARGE_INTEGER uli = {0};
- if (FAILED(pStream->Seek(li, STREAM_SEEK_SET, NULL))
+ if (FAILED(pStream->Seek(li, STREAM_SEEK_SET, nullptr))
|| FAILED(pStream->SetSize(uli))) {
break;
}
@@ -144,8 +144,8 @@ DWORD CStreamDriveThruFilter::ThreadProc()
pFSF->SetMode(AM_FILE_OVERWRITE);
LPOLESTR pfn;
- if (SUCCEEDED(pFSF->GetCurFile(&pfn, NULL))) {
- pFSF->SetFileName(pfn, NULL);
+ if (SUCCEEDED(pFSF->GetCurFile(&pfn, nullptr))) {
+ pFSF->SetFileName(pfn, nullptr);
CoTaskMemFree(pfn);
}
}
@@ -219,7 +219,7 @@ CBasePin* CStreamDriveThruFilter::GetPin(int n)
return m_pOutput;
}
- return NULL;
+ return nullptr;
}
STDMETHODIMP CStreamDriveThruFilter::Stop()
@@ -387,7 +387,7 @@ HRESULT CStreamDriveThruInputPin::GetAsyncReader(IAsyncReader** ppAsyncReader)
{
CheckPointer(ppAsyncReader, E_POINTER);
- *ppAsyncReader = NULL;
+ *ppAsyncReader = nullptr;
CheckPointer(m_pAsyncReader, VFW_E_NOT_CONNECTED);
@@ -481,7 +481,7 @@ HRESULT CStreamDriveThruOutputPin::GetStream(IStream** ppStream)
{
CheckPointer(ppStream, E_POINTER);
- *ppStream = NULL;
+ *ppStream = nullptr;
CheckPointer(m_pStream, VFW_E_NOT_CONNECTED);
diff --git a/src/filters/reader/CDDAReader/CDDAReader.cpp b/src/filters/reader/CDDAReader/CDDAReader.cpp
index 33e0b4a71..dae77eab3 100644
--- a/src/filters/reader/CDDAReader/CDDAReader.cpp
+++ b/src/filters/reader/CDDAReader/CDDAReader.cpp
@@ -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.
*
@@ -36,7 +36,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut},
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -44,7 +44,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDDAReader>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDDAReader>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -293,14 +293,14 @@ bool CCDDAStream::Load(const WCHAR* fnw)
m_hDrive = INVALID_HANDLE_VALUE;
}
- m_hDrive = CreateFile(drive, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
+ m_hDrive = CreateFile(drive, GENERIC_READ, FILE_SHARE_READ, nullptr,
+ OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)nullptr);
if (m_hDrive == INVALID_HANDLE_VALUE) {
return false;
}
DWORD BytesReturned;
- if (!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC, NULL, 0, &m_TOC, sizeof(m_TOC), &BytesReturned, 0)
+ if (!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC, nullptr, 0, &m_TOC, sizeof(m_TOC), &BytesReturned, 0)
|| !(m_TOC.FirstTrack <= iTrackIndex && iTrackIndex <= m_TOC.LastTrack)) {
CloseHandle(m_hDrive);
m_hDrive = INVALID_HANDLE_VALUE;
diff --git a/src/filters/reader/CDXAReader/CDXAReader.cpp b/src/filters/reader/CDXAReader/CDXAReader.cpp
index 0fcb4838a..f2b17e183 100644
--- a/src/filters/reader/CDXAReader/CDXAReader.cpp
+++ b/src/filters/reader/CDXAReader/CDXAReader.cpp
@@ -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.
*
@@ -118,7 +118,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -126,7 +126,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDXAReader>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDXAReader>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -242,15 +242,15 @@ bool CCDXAStream::Load(const WCHAR* fnw)
m_hFile = INVALID_HANDLE_VALUE;
}
- m_hFile = CreateFile(CString(fnw), GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
+ m_hFile = CreateFile(CString(fnw), GENERIC_READ, FILE_SHARE_READ, nullptr,
+ OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)nullptr);
if (m_hFile == INVALID_HANDLE_VALUE) {
return false;
}
BYTE hdr[RIFFCDXA_HEADER_SIZE];
DWORD NumberOfBytesRead;
- if (!ReadFile(m_hFile, (LPVOID)hdr, RIFFCDXA_HEADER_SIZE, &NumberOfBytesRead, NULL)
+ if (!ReadFile(m_hFile, (LPVOID)hdr, RIFFCDXA_HEADER_SIZE, &NumberOfBytesRead, nullptr)
|| *((DWORD*)&hdr[0]) != 'FFIR' || *((DWORD*)&hdr[8]) != 'AXDC'
|| *((DWORD*)&hdr[4]) != (*((DWORD*)&hdr[0x28]) + 0x24)) {
CloseHandle(m_hFile);
@@ -305,7 +305,7 @@ HRESULT CCDXAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
int nRetries = 3;
while (nRetries--) {
NumberOfBytesRead = 0;
- if (!ReadFile(m_hFile, m_sector, RAW_SECTOR_SIZE, &NumberOfBytesRead, NULL)
+ if (!ReadFile(m_hFile, m_sector, RAW_SECTOR_SIZE, &NumberOfBytesRead, nullptr)
|| NumberOfBytesRead != RAW_SECTOR_SIZE) {
break;
}
@@ -378,7 +378,7 @@ bool CCDXAStream::LookForMediaSubType()
m_llPosition = 0;
for (int iSectorsRead = 0;
- Read(buff, RAW_DATA_SIZE, 1, NULL) == S_OK && iSectorsRead < 1000;
+ Read(buff, RAW_DATA_SIZE, 1, nullptr) == S_OK && iSectorsRead < 1000;
iSectorsRead++) {
if (*((DWORD*)&buff[0]) == 0xba010000) {
m_llPosition = 0;
@@ -472,7 +472,7 @@ bool CCDXAStream::LookForMediaSubType()
CString s = p.Mid(k, l - k);
TRACE(s + '\n');
- TCHAR* end = NULL;
+ TCHAR* end = nullptr;
switch (nTries & 3) {
case 0:
diff --git a/src/filters/reader/UDPReader/UDPReader.cpp b/src/filters/reader/UDPReader/UDPReader.cpp
index c32c7d829..1e1e73cd6 100644
--- a/src/filters/reader/UDPReader/UDPReader.cpp
+++ b/src/filters/reader/UDPReader/UDPReader.cpp
@@ -32,7 +32,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -40,7 +40,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CUDPReader>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CUDPReader>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -352,9 +352,9 @@ DWORD CUDPStream::ThreadProc()
SetThreadPriority(m_hThread, THREAD_PRIORITY_TIME_CRITICAL);
#ifdef _DEBUG
- FILE* dump = NULL;
+ FILE* dump = nullptr;
// dump = _tfopen(_T("c:\\udp.ts"), _T("wb"));
- FILE* log = NULL;
+ FILE* log = nullptr;
// log = _tfopen(_T("c:\\udp.txt"), _T("wt"));
#endif
@@ -388,7 +388,7 @@ DWORD CUDPStream::ThreadProc()
for (unsigned int i = 0; ; i++) {
if (!(i & 0xff)) {
- if (CheckRequest(NULL)) {
+ if (CheckRequest(nullptr)) {
break;
}
}
diff --git a/src/filters/reader/VTSReader/VTSReader.cpp b/src/filters/reader/VTSReader/VTSReader.cpp
index d79eaf835..3d2d94846 100644
--- a/src/filters/reader/VTSReader/VTSReader.cpp
+++ b/src/filters/reader/VTSReader/VTSReader.cpp
@@ -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.
*
@@ -31,7 +31,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -39,7 +39,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CVTSReader>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CVTSReader>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -177,22 +177,22 @@ STDMETHODIMP_(BSTR) CVTSReader::GetTrackName(UINT aTrackIdx)
STDMETHODIMP_(BSTR) CVTSReader::GetTrackCodecID(UINT aTrackIdx)
{
- return NULL; // Not implemented yet
+ return nullptr; // Not implemented yet
}
STDMETHODIMP_(BSTR) CVTSReader::GetTrackCodecName(UINT aTrackIdx)
{
- return NULL; // Not implemented yet
+ return nullptr; // Not implemented yet
}
STDMETHODIMP_(BSTR) CVTSReader::GetTrackCodecInfoURL(UINT aTrackIdx)
{
- return NULL; // Not implemented yet
+ return nullptr; // Not implemented yet
}
STDMETHODIMP_(BSTR) CVTSReader::GetTrackCodecDownloadURL(UINT aTrackIdx)
{
- return NULL; // Not implemented yet
+ return nullptr; // Not implemented yet
}
// CVTSStream
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
index ade31710b..0684941b9 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
@@ -38,7 +38,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesIn[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -46,7 +46,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, &__uuidof(CMpcAudioRenderer), CreateInstance<CMpcAudioRenderer>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, &__uuidof(CMpcAudioRenderer), CreateInstance<CMpcAudioRenderer>, nullptr, &sudFilter[0]},
{L"CMpcAudioRendererPropertyPage", &__uuidof(CMpcAudioRendererSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpcAudioRendererSettingsWnd>>},
};
@@ -79,7 +79,7 @@ bool CALLBACK DSEnumProc2(LPGUID lpGUID,
ASSERT(pStr);
CString strGUID = *pStr;
- if (lpGUID != NULL) { // NULL only for "Primary Sound Driver".
+ if (lpGUID != nullptr) { // NULL only for "Primary Sound Driver".
if (strGUID == lpszDesc) {
memcpy((VOID*)&lpSoundGUID, lpGUID, sizeof(GUID));
}
@@ -90,23 +90,23 @@ bool CALLBACK DSEnumProc2(LPGUID lpGUID,
CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT* phr)
: CBaseRenderer(__uuidof(this), MpcAudioRendererName, punk, phr)
- , m_pDSBuffer(NULL)
- , m_pSoundTouch(NULL)
- , m_pDS(NULL)
+ , m_pDSBuffer(nullptr)
+ , m_pSoundTouch(nullptr)
+ , m_pDS(nullptr)
, m_dwDSWriteOff(0)
, m_nDSBufSize(0)
, m_dRate(1.0)
- , m_pReferenceClock(NULL)
- , m_pWaveFileFormat(NULL)
- , pMMDevice(NULL)
- , pAudioClient(NULL)
- , pRenderClient(NULL)
+ , m_pReferenceClock(nullptr)
+ , m_pWaveFileFormat(nullptr)
+ , pMMDevice(nullptr)
+ , pAudioClient(nullptr)
+ , pRenderClient(nullptr)
, m_useWASAPI(true)
, m_bMuteFastForward(false)
, m_csSound_Device(_T(""))
, nFramesInBuffer(0)
, hnsPeriod(0)
- , hTask(NULL)
+ , hTask(nullptr)
, bufferSize(0)
, isAudioClientStarted(false)
, lastBufferTime(0)
@@ -142,7 +142,7 @@ CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT* phr)
// Load Vista specific DLLs
m_hLibAVRT = LoadLibrary(L"avrt.dll");
- if (m_hLibAVRT != NULL) {
+ if (m_hLibAVRT != nullptr) {
pfAvSetMmThreadCharacteristicsW = (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress(m_hLibAVRT, "AvSetMmThreadCharacteristicsW");
pfAvRevertMmThreadCharacteristics = (PTR_AvRevertMmThreadCharacteristics) GetProcAddress(m_hLibAVRT, "AvRevertMmThreadCharacteristics");
} else {
@@ -153,7 +153,7 @@ CMpcAudioRenderer::CMpcAudioRenderer(LPUNKNOWN punk, HRESULT* phr)
if (!m_useWASAPI) {
DirectSoundEnumerate((LPDSENUMCALLBACK)DSEnumProc2, (VOID*)&m_csSound_Device);
m_pSoundTouch = DEBUG_NEW soundtouch::SoundTouch();
- *phr = DirectSoundCreate8(&lpSoundGUID, &m_pDS, NULL);
+ *phr = DirectSoundCreate8(&lpSoundGUID, &m_pDS, nullptr);
}
}
@@ -170,7 +170,7 @@ CMpcAudioRenderer::~CMpcAudioRenderer()
SAFE_RELEASE(pMMDevice);
if (m_pReferenceClock) {
- SetSyncSource(NULL);
+ SetSyncSource(nullptr);
SAFE_RELEASE(m_pReferenceClock);
}
@@ -179,7 +179,7 @@ CMpcAudioRenderer::~CMpcAudioRenderer()
SAFE_DELETE_ARRAY(p);
}
- if (hTask != NULL && pfAvRevertMmThreadCharacteristics != NULL) {
+ if (hTask != nullptr && pfAvRevertMmThreadCharacteristics != nullptr) {
pfAvRevertMmThreadCharacteristics(hTask);
}
@@ -196,13 +196,13 @@ HRESULT CMpcAudioRenderer::CheckInputType(const CMediaType* pmt)
HRESULT CMpcAudioRenderer::CheckMediaType(const CMediaType* pmt)
{
HRESULT hr = S_OK;
- if (pmt == NULL) {
+ if (pmt == nullptr) {
return E_INVALIDARG;
}
TRACE(_T("CMpcAudioRenderer::CheckMediaType\n"));
WAVEFORMATEX* pwfx = (WAVEFORMATEX*) pmt->Format();
- if (pwfx == NULL) {
+ if (pwfx == nullptr) {
return VFW_E_TYPE_NOT_ACCEPTED;
}
@@ -213,7 +213,7 @@ HRESULT CMpcAudioRenderer::CheckMediaType(const CMediaType* pmt)
}
if (m_useWASAPI) {
- hr = CheckAudioClient((WAVEFORMATEX*)NULL);
+ hr = CheckAudioClient((WAVEFORMATEX*)nullptr);
if (FAILED(hr)) {
TRACE(_T("CMpcAudioRenderer::CheckMediaType Error on check audio client\n"));
return hr;
@@ -223,7 +223,7 @@ HRESULT CMpcAudioRenderer::CheckMediaType(const CMediaType* pmt)
return VFW_E_CANNOT_CONNECT;
}
- if (pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL) != S_OK) {
+ if (pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, nullptr) != S_OK) {
TRACE(_T("CMpcAudioRenderer::CheckMediaType WASAPI client refused the format\n"));
return VFW_E_TYPE_NOT_ACCEPTED;
}
@@ -247,7 +247,7 @@ BOOL CMpcAudioRenderer::ScheduleSample(IMediaSample* pMediaSample)
REFERENCE_TIME EndSample;
// Is someone pulling our leg
- if (pMediaSample == NULL) {
+ if (pMediaSample == nullptr) {
return FALSE;
}
@@ -326,7 +326,7 @@ HRESULT CMpcAudioRenderer::SetMediaType(const CMediaType* pmt)
if (m_useWASAPI) {
// New media type set but render client already initialized => reset it
- if (pRenderClient != NULL) {
+ if (pRenderClient != nullptr) {
WAVEFORMATEX* pNewWf = (WAVEFORMATEX*) pmt->Format();
TRACE(_T("CMpcAudioRenderer::SetMediaType Render client already initialized. Reinitialization...\n"));
if (FAILED(CheckAudioClient(pNewWf))) {
@@ -340,10 +340,10 @@ HRESULT CMpcAudioRenderer::SetMediaType(const CMediaType* pmt)
BYTE* p = (BYTE*)m_pWaveFileFormat;
SAFE_DELETE_ARRAY(p);
}
- m_pWaveFileFormat = NULL;
+ m_pWaveFileFormat = nullptr;
WAVEFORMATEX* pwf = (WAVEFORMATEX*) pmt->Format();
- if (pwf != NULL) {
+ if (pwf != nullptr) {
int size = sizeof(WAVEFORMATEX) + pwf->cbSize;
m_pWaveFileFormat = (WAVEFORMATEX*)DEBUG_NEW BYTE[size];
@@ -535,7 +535,7 @@ STDMETHODIMP CMpcAudioRenderer::GetPages(CAUUID* pPages)
pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpcAudioRendererSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -548,14 +548,14 @@ STDMETHODIMP CMpcAudioRenderer::CreatePage(const GUID& guid, IPropertyPage** ppP
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpcAudioRendererSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpcAudioRendererSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpcAudioRendererSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -624,7 +624,7 @@ HRESULT CMpcAudioRenderer::GetReferenceClockInterface(REFIID riid, void** ppv)
return m_pReferenceClock->NonDelegatingQueryInterface(riid, ppv);
}
- m_pReferenceClock = DEBUG_NEW CBaseReferenceClock(NAME("Mpc Audio Clock"), NULL, &hr);
+ m_pReferenceClock = DEBUG_NEW CBaseReferenceClock(NAME("Mpc Audio Clock"), nullptr, &hr);
if (!m_pReferenceClock) {
return E_OUTOFMEMORY;
}
@@ -633,7 +633,7 @@ HRESULT CMpcAudioRenderer::GetReferenceClockInterface(REFIID riid, void** ppv)
hr = SetSyncSource(m_pReferenceClock);
if (FAILED(hr)) {
- SetSyncSource(NULL);
+ SetSyncSource(nullptr);
return hr;
}
@@ -664,7 +664,7 @@ HRESULT CMpcAudioRenderer::CreateDSBuffer()
}
HRESULT hr = S_OK;
- LPDIRECTSOUNDBUFFER pDSBPrimary = NULL;
+ LPDIRECTSOUNDBUFFER pDSBPrimary = nullptr;
DSBUFFERDESC dsbd;
DSBUFFERDESC cDSBufferDesc;
DSBCAPS bufferCaps;
@@ -676,8 +676,8 @@ HRESULT CMpcAudioRenderer::CreateDSBuffer()
dsbd.dwSize = sizeof(DSBUFFERDESC);
dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
dsbd.dwBufferBytes = 0;
- dsbd.lpwfxFormat = NULL;
- if (SUCCEEDED(hr = m_pDS->CreateSoundBuffer(&dsbd, &pDSBPrimary, NULL))) {
+ dsbd.lpwfxFormat = nullptr;
+ if (SUCCEEDED(hr = m_pDS->CreateSoundBuffer(&dsbd, &pDSBPrimary, nullptr))) {
hr = pDSBPrimary->SetFormat(m_pWaveFileFormat);
_ASSERTE(SUCCEEDED(hr));
SAFE_RELEASE(pDSBPrimary);
@@ -693,7 +693,7 @@ HRESULT CMpcAudioRenderer::CreateDSBuffer()
cDSBufferDesc.lpwfxFormat = m_pWaveFileFormat;
cDSBufferDesc.guid3DAlgorithm = GUID_NULL;
- hr = m_pDS->CreateSoundBuffer(&cDSBufferDesc, &m_pDSBuffer, NULL);
+ hr = m_pDS->CreateSoundBuffer(&cDSBufferDesc, &m_pDSBuffer, nullptr);
m_nDSBufSize = 0;
if (SUCCEEDED(hr)) {
@@ -712,17 +712,17 @@ HRESULT CMpcAudioRenderer::CreateDSBuffer()
HRESULT CMpcAudioRenderer::ClearBuffer()
{
HRESULT hr = S_FALSE;
- VOID* pDSLockedBuffer = NULL;
+ VOID* pDSLockedBuffer = nullptr;
DWORD dwDSLockedSize = 0;
if (m_pDSBuffer) {
m_dwDSWriteOff = 0;
m_pDSBuffer->SetCurrentPosition(0);
- hr = m_pDSBuffer->Lock(0, 0, &pDSLockedBuffer, &dwDSLockedSize, NULL, NULL, DSBLOCK_ENTIREBUFFER);
+ hr = m_pDSBuffer->Lock(0, 0, &pDSLockedBuffer, &dwDSLockedSize, nullptr, nullptr, DSBLOCK_ENTIREBUFFER);
if (SUCCEEDED(hr)) {
memset(pDSLockedBuffer, 0, dwDSLockedSize);
- hr = m_pDSBuffer->Unlock(pDSLockedBuffer, dwDSLockedSize, NULL, NULL);
+ hr = m_pDSBuffer->Unlock(pDSLockedBuffer, dwDSLockedSize, nullptr, 0);
}
}
@@ -732,8 +732,8 @@ HRESULT CMpcAudioRenderer::ClearBuffer()
HRESULT CMpcAudioRenderer::InitCoopLevel()
{
HRESULT hr = S_OK;
- IVideoWindow* pVideoWindow = NULL;
- HWND hWnd = NULL;
+ IVideoWindow* pVideoWindow = nullptr;
+ HWND hWnd = nullptr;
CComBSTR bstrCaption;
hr = m_pGraph->QueryInterface(__uuidof(IVideoWindow), (void**) &pVideoWindow);
@@ -742,13 +742,13 @@ HRESULT CMpcAudioRenderer::InitCoopLevel()
SAFE_RELEASE(pVideoWindow);
}
if (!hWnd) {
- hWnd = GetTopWindow(NULL);
+ hWnd = GetTopWindow(nullptr);
}
- _ASSERTE(hWnd != NULL);
+ _ASSERTE(hWnd != nullptr);
if (!m_useWASAPI) {
hr = m_pDS->SetCooperativeLevel(hWnd, DSSCL_PRIORITY);
- } else if (hTask == NULL) {
+ } else if (hTask == nullptr) {
// Ask MMCSS to temporarily boost the thread priority
// to reduce glitches while the low-latency stream plays.
DWORD taskIndex = 0;
@@ -757,7 +757,7 @@ HRESULT CMpcAudioRenderer::InitCoopLevel()
hTask = pfAvSetMmThreadCharacteristicsW(_T("Pro Audio"), &taskIndex);
TRACE(_T("CMpcAudioRenderer::InitCoopLevel Putting thread in higher priority for Wasapi mode (lowest latency)\n"));
hr = GetLastError();
- if (hTask == NULL) {
+ if (hTask == nullptr) {
return hr;
}
}
@@ -811,7 +811,7 @@ HRESULT CMpcAudioRenderer::DoRenderSampleDirectSound(IMediaSample* pMediaSample)
}
if (SUCCEEDED(hr)) {
- hr = WriteSampleToDSBuffer(pMediaSample, NULL);
+ hr = WriteSampleToDSBuffer(pMediaSample, nullptr);
}
return hr;
@@ -827,9 +827,9 @@ HRESULT CMpcAudioRenderer::WriteSampleToDSBuffer(IMediaSample* pMediaSample, boo
REFERENCE_TIME rtStop = 0;
HRESULT hr = S_OK;
bool loop = false;
- VOID* pDSLockedBuffers[2] = { NULL, NULL };
+ VOID* pDSLockedBuffers[2] = { nullptr, nullptr };
DWORD dwDSLockedSize[2] = { 0, 0 };
- BYTE* pMediaBuffer = NULL;
+ BYTE* pMediaBuffer = nullptr;
long lSize = pMediaSample->GetActualDataLength();
hr = pMediaSample->GetPointer(&pMediaBuffer);
@@ -855,12 +855,12 @@ HRESULT CMpcAudioRenderer::WriteSampleToDSBuffer(IMediaSample* pMediaSample, boo
hr = m_pDSBuffer->Lock(m_dwDSWriteOff, lSize, &pDSLockedBuffers[0], &dwDSLockedSize[0], &pDSLockedBuffers[1], &dwDSLockedSize[1], 0);
}
if (SUCCEEDED(hr)) {
- if (pDSLockedBuffers [0] != NULL) {
+ if (pDSLockedBuffers [0] != nullptr) {
memcpy(pDSLockedBuffers[0], pMediaBuffer, dwDSLockedSize[0]);
m_dwDSWriteOff += dwDSLockedSize[0];
}
- if (pDSLockedBuffers [1] != NULL) {
+ if (pDSLockedBuffers [1] != nullptr) {
memcpy(pDSLockedBuffers[1], &pMediaBuffer[dwDSLockedSize[0]], dwDSLockedSize[1]);
m_dwDSWriteOff = dwDSLockedSize[1];
loop = true;
@@ -886,18 +886,18 @@ HRESULT CMpcAudioRenderer::DoRenderSampleWasapi(IMediaSample* pMediaSample)
HRESULT hr = S_OK;
REFERENCE_TIME rtStart = 0;
REFERENCE_TIME rtStop = 0;
- BYTE* pMediaBuffer = NULL;
- BYTE* pInputBufferPointer = NULL;
- BYTE* pInputBufferEnd = NULL;
+ BYTE* pMediaBuffer = nullptr;
+ BYTE* pInputBufferPointer = nullptr;
+ BYTE* pInputBufferEnd = nullptr;
BYTE* pData;
bufferSize = pMediaSample->GetActualDataLength();
const long lSize = bufferSize;
pMediaSample->GetTime(&rtStart, &rtStop);
AM_MEDIA_TYPE* pmt;
- if (SUCCEEDED(pMediaSample->GetMediaType(&pmt)) && pmt != NULL) {
+ if (SUCCEEDED(pMediaSample->GetMediaType(&pmt)) && pmt != nullptr) {
CMediaType mt(*pmt);
- if ((WAVEFORMATEXTENSIBLE*)mt.Format() != NULL) {
+ if ((WAVEFORMATEXTENSIBLE*)mt.Format() != nullptr) {
hr = CheckAudioClient(&(((WAVEFORMATEXTENSIBLE*)mt.Format())->Format));
} else {
hr = CheckAudioClient((WAVEFORMATEX*)mt.Format());
@@ -907,7 +907,7 @@ HRESULT CMpcAudioRenderer::DoRenderSampleWasapi(IMediaSample* pMediaSample)
return hr;
}
DeleteMediaType(pmt);
- pmt = NULL;
+ pmt = nullptr;
}
// Initialization
@@ -951,7 +951,7 @@ HRESULT CMpcAudioRenderer::DoRenderSampleWasapi(IMediaSample* pMediaSample)
}
// Load the buffer with data from the audio source.
- if (pData != NULL) {
+ if (pData != nullptr) {
memcpy(&pData[0], pInputBufferPointer, nBytesToWrite);
pInputBufferPointer += nBytesToWrite;
@@ -995,17 +995,17 @@ HRESULT CMpcAudioRenderer::CheckAudioClient(WAVEFORMATEX* pWaveFormatEx)
HRESULT hr = S_OK;
CAutoLock cAutoLock(&m_csCheck);
TRACE(_T("CMpcAudioRenderer::CheckAudioClient\n"));
- if (pMMDevice == NULL) {
+ if (pMMDevice == nullptr) {
hr = GetAudioDevice(&pMMDevice);
}
// If no WAVEFORMATEX structure provided and client already exists, return it
- if (pAudioClient != NULL && pWaveFormatEx == NULL) {
+ if (pAudioClient != nullptr && pWaveFormatEx == nullptr) {
return hr;
}
// Just create the audio client if no WAVEFORMATEX provided
- if (pAudioClient == NULL && pWaveFormatEx == NULL) {
+ if (pAudioClient == nullptr && pWaveFormatEx == nullptr) {
if (SUCCEEDED(hr)) {
hr = CreateAudioClient(pMMDevice, &pAudioClient);
}
@@ -1013,7 +1013,7 @@ HRESULT CMpcAudioRenderer::CheckAudioClient(WAVEFORMATEX* pWaveFormatEx)
}
// Compare the exisiting WAVEFORMATEX with the one provided
- WAVEFORMATEX* pNewWaveFormatEx = NULL;
+ WAVEFORMATEX* pNewWaveFormatEx = nullptr;
if (CheckFormatChanged(pWaveFormatEx, &pNewWaveFormatEx)) {
// Format has changed, audio client has to be reinitialized
TRACE(_T("CMpcAudioRenderer::CheckAudioClient Format changed, reinitialize the audio client\n"));
@@ -1022,9 +1022,9 @@ HRESULT CMpcAudioRenderer::CheckAudioClient(WAVEFORMATEX* pWaveFormatEx)
SAFE_DELETE_ARRAY(p);
}
m_pWaveFileFormat = pNewWaveFormatEx;
- hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pWaveFormatEx, NULL);
+ hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pWaveFormatEx, nullptr);
if (SUCCEEDED(hr)) {
- if (pAudioClient != NULL && isAudioClientStarted) {
+ if (pAudioClient != nullptr && isAudioClientStarted) {
pAudioClient->Stop();
}
isAudioClientStarted = false;
@@ -1037,7 +1037,7 @@ HRESULT CMpcAudioRenderer::CheckAudioClient(WAVEFORMATEX* pWaveFormatEx)
TRACE(_T("CMpcAudioRenderer::CheckAudioClient New format not supported, accept it anyway\n"));
return S_OK;
}
- } else if (pRenderClient == NULL) {
+ } else if (pRenderClient == nullptr) {
TRACE(_T("CMpcAudioRenderer::CheckAudioClient First initialization of the audio renderer\n"));
} else {
return hr;
@@ -1064,9 +1064,9 @@ HRESULT CMpcAudioRenderer::GetAvailableAudioDevices(IMMDeviceCollection** ppMMDe
return S_FALSE;
}
- //IMMDevice* pEndpoint = NULL;
- //IPropertyStore* pProps = NULL;
- //LPWSTR pwszID = NULL;
+ //IMMDevice* pEndpoint = nullptr;
+ //IPropertyStore* pProps = nullptr;
+ //LPWSTR pwszID = nullptr;
enumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, ppMMDevices);
UINT count(0);
@@ -1080,7 +1080,7 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
CComPtr<IMMDeviceEnumerator> enumerator;
IMMDeviceCollection* devices;
- IPropertyStore* pProps = NULL;
+ IPropertyStore* pProps = nullptr;
HRESULT hr = enumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator));
if (hr != S_OK) {
@@ -1099,8 +1099,8 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
}
for (ULONG i = 0 ; i < count ; i++) {
- LPWSTR pwszID = NULL;
- IMMDevice* endpoint = NULL;
+ LPWSTR pwszID = nullptr;
+ IMMDevice* endpoint = nullptr;
hr = devices->Item(i, &endpoint);
if (hr == S_OK) {
hr = endpoint->GetId(&pwszID);
@@ -1117,7 +1117,7 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
SAFE_RELEASE(devices);
*(ppMMDevice) = endpoint;
CoTaskMemFree(pwszID);
- pwszID = NULL;
+ pwszID = nullptr;
PropVariantClear(&varName);
SAFE_RELEASE(pProps);
return S_OK;
@@ -1126,7 +1126,7 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
SAFE_RELEASE(pProps);
SAFE_RELEASE(endpoint);
CoTaskMemFree(pwszID);
- pwszID = NULL;
+ pwszID = nullptr;
}
}
} else {
@@ -1137,7 +1137,7 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
}
CoTaskMemFree(pwszID);
- pwszID = NULL;
+ pwszID = nullptr;
}
}
@@ -1152,7 +1152,7 @@ HRESULT CMpcAudioRenderer::GetAudioDevice(IMMDevice** ppMMDevice)
bool CMpcAudioRenderer::CheckFormatChanged(WAVEFORMATEX* pWaveFormatEx, WAVEFORMATEX** ppNewWaveFormatEx)
{
bool formatChanged = false;
- if (m_pWaveFileFormat == NULL) {
+ if (m_pWaveFileFormat == nullptr) {
formatChanged = true;
} else if (pWaveFormatEx->wFormatTag != m_pWaveFileFormat->wFormatTag
|| pWaveFormatEx->nChannels != m_pWaveFileFormat->nChannels
@@ -1176,7 +1176,7 @@ bool CMpcAudioRenderer::CheckFormatChanged(WAVEFORMATEX* pWaveFormatEx, WAVEFORM
HRESULT CMpcAudioRenderer::GetBufferSize(WAVEFORMATEX* pWaveFormatEx, REFERENCE_TIME* pHnsBufferPeriod)
{
- if (pWaveFormatEx == NULL) {
+ if (pWaveFormatEx == nullptr) {
return S_OK;
}
if (pWaveFormatEx->cbSize < 22) { //WAVEFORMATEX
@@ -1212,10 +1212,10 @@ HRESULT CMpcAudioRenderer::InitAudioClient(WAVEFORMATEX* pWaveFormatEx, IAudioCl
TRACE(_T("CMpcAudioRenderer::InitAudioClient\n"));
HRESULT hr = S_OK;
// Initialize the stream to play at the minimum latency.
- //if (SUCCEEDED (hr)) hr = pAudioClient->GetDevicePeriod(NULL, &hnsPeriod);
+ //if (SUCCEEDED (hr)) hr = pAudioClient->GetDevicePeriod(nullptr, &hnsPeriod);
hnsPeriod = 500000; //50 ms is the best according to James @Slysoft
- hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pWaveFormatEx, NULL);
+ hr = pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, pWaveFormatEx, nullptr);
if (FAILED(hr)) {
TRACE(_T("CMpcAudioRenderer::InitAudioClient not supported (0x%08x)\n"), hr);
} else {
@@ -1226,7 +1226,7 @@ HRESULT CMpcAudioRenderer::InitAudioClient(WAVEFORMATEX* pWaveFormatEx, IAudioCl
if (SUCCEEDED(hr)) {
hr = pAudioClient->Initialize(AUDCLNT_SHAREMODE_EXCLUSIVE, 0/*AUDCLNT_STREAMFLAGS_EVENTCALLBACK*/,
- hnsPeriod, hnsPeriod, pWaveFormatEx, NULL);
+ hnsPeriod, hnsPeriod, pWaveFormatEx, nullptr);
}
if (FAILED(hr) && hr != AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) {
TRACE(_T("CMpcAudioRenderer::InitAudioClient failed (0x%08x)\n"), hr);
@@ -1242,7 +1242,7 @@ HRESULT CMpcAudioRenderer::InitAudioClient(WAVEFORMATEX* pWaveFormatEx, IAudioCl
// throw away this IAudioClient
pAudioClient->Release();
- pAudioClient = NULL;
+ pAudioClient = nullptr;
// calculate the new aligned periodicity
hnsPeriod = // hns =
@@ -1260,7 +1260,7 @@ HRESULT CMpcAudioRenderer::InitAudioClient(WAVEFORMATEX* pWaveFormatEx, IAudioCl
TRACE(_T("CMpcAudioRenderer::InitAudioClient Trying again with periodicity of %I64u hundred-nanoseconds, or %u frames.\n"), hnsPeriod, nFramesInBuffer);
if (SUCCEEDED(hr)) {
hr = pAudioClient->Initialize(AUDCLNT_SHAREMODE_EXCLUSIVE, 0/*AUDCLNT_STREAMFLAGS_EVENTCALLBACK*/,
- hnsPeriod, hnsPeriod, pWaveFormatEx, NULL);
+ hnsPeriod, hnsPeriod, pWaveFormatEx, nullptr);
}
if (FAILED(hr)) {
TRACE(_T("CMpcAudioRenderer::InitAudioClient Failed to reinitialize the audio client\n"));
@@ -1302,12 +1302,12 @@ HRESULT CMpcAudioRenderer::CreateAudioClient(IMMDevice* pMMDevice, IAudioClient*
isAudioClientStarted = false;
}
- if (pMMDevice == NULL) {
+ if (pMMDevice == nullptr) {
TRACE(_T("CMpcAudioRenderer::CreateAudioClient failed, device not loaded\n"));
return E_FAIL;
}
- hr = pMMDevice->Activate(__uuidof(IAudioClient), CLSCTX_ALL, NULL, reinterpret_cast<void**>(ppAudioClient));
+ hr = pMMDevice->Activate(__uuidof(IAudioClient), CLSCTX_ALL, nullptr, reinterpret_cast<void**>(ppAudioClient));
if (FAILED(hr)) {
TRACE(_T("CMpcAudioRenderer::CreateAudioClient activation failed (0x%08x)\n"), hr);
} else {
diff --git a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
index 1d29fe19c..bef4b275c 100644
--- a/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
+++ b/src/filters/renderer/MpcAudioRenderer/MpcAudioRendererSettingsWnd.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2010-2012 see Authors.txt
+ * (C) 2010-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -60,10 +60,10 @@ bool CALLBACK DSEnumProc(LPGUID lpGUID,
{
CComboBox* pCombo = (CComboBox*)lpContext;
ASSERT(pCombo);
- LPGUID lpTemp = NULL;
+ LPGUID lpTemp = nullptr;
- if (lpGUID != NULL) { // NULL only for "Primary Sound Driver".
- if ((lpTemp = (LPGUID)malloc(sizeof(GUID))) == NULL) {
+ if (lpGUID != nullptr) { // NULL only for "Primary Sound Driver".
+ if ((lpTemp = (LPGUID)malloc(sizeof(GUID))) == nullptr) {
return TRUE;
}
memcpy(lpTemp, lpGUID, sizeof(GUID));
diff --git a/src/filters/renderer/SyncClock/SyncClock.cpp b/src/filters/renderer/SyncClock/SyncClock.cpp
index 5fb6942f2..5b2a6a0d9 100644
--- a/src/filters/renderer/SyncClock/SyncClock.cpp
+++ b/src/filters/renderer/SyncClock/SyncClock.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2010-2012 see Authors.txt
+ * (C) 2010-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -22,7 +22,7 @@
#include "SyncClock.h"
CSyncClockFilter::CSyncClockFilter(LPUNKNOWN pUnk, HRESULT* phr)
- : CBaseFilter(NAME("SyncClock"), NULL, &m_Lock, CLSID_NULL)
+ : CBaseFilter(NAME("SyncClock"), nullptr, &m_Lock, CLSID_NULL)
, m_Clock(static_cast<IBaseFilter*>(this), phr)
{
}
@@ -76,7 +76,7 @@ int CSyncClockFilter::GetPinCount()
CBasePin* CSyncClockFilter::GetPin(int i)
{
UNREFERENCED_PARAMETER(i);
- return NULL;
+ return nullptr;
}
// CSyncClock methods
diff --git a/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp b/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
index 159a83a76..18286033b 100644
--- a/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
+++ b/src/filters/renderer/VideoRenderers/AllocatorCommon.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -46,7 +46,7 @@ HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISubPicAlloca
{
CheckPointer(ppAP, E_POINTER);
- *ppAP = NULL;
+ *ppAP = nullptr;
using namespace DSObjects;
@@ -67,7 +67,7 @@ HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISubPicAlloca
return E_FAIL;
}
- if (*ppAP == NULL) {
+ if (*ppAP == nullptr) {
return E_OUTOFMEMORY;
}
@@ -75,11 +75,11 @@ HRESULT CreateAP9(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISubPicAlloca
if (FAILED(hr)) {
Error += L"\n";
- Error += GetWindowsErrorMessage(hr, NULL);
+ Error += GetWindowsErrorMessage(hr, nullptr);
MessageBox(hWnd, Error, L"Error creating DX9 allocation presenter", MB_OK | MB_ICONERROR);
(*ppAP)->Release();
- *ppAP = NULL;
+ *ppAP = nullptr;
} else if (!Error.IsEmpty()) {
MessageBox(hWnd, Error, L"Warning creating DX9 allocation presenter", MB_OK | MB_ICONWARNING);
}
@@ -97,10 +97,10 @@ HRESULT CreateEVR(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISubPicAlloca
if (FAILED(hr)) {
Error += L"\n";
- Error += GetWindowsErrorMessage(hr, NULL);
+ Error += GetWindowsErrorMessage(hr, nullptr);
MessageBox(hWnd, Error, L"Error creating EVR Custom renderer", MB_OK | MB_ICONERROR);
(*ppAP)->Release();
- *ppAP = NULL;
+ *ppAP = nullptr;
} else if (!Error.IsEmpty()) {
MessageBox(hWnd, Error, L"Warning creating EVR Custom renderer", MB_OK | MB_ICONWARNING);
}
@@ -178,7 +178,7 @@ CString GetWindowsErrorMessage(HRESULT _Error, HMODULE _Module)
CString errmsg;
LPVOID lpMsgBuf;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
- _Module, _Error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL)) {
+ _Module, _Error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, nullptr)) {
errmsg = (LPCTSTR)lpMsgBuf;
LocalFree(lpMsgBuf);
}
diff --git a/src/filters/renderer/VideoRenderers/AllocatorCommon7.cpp b/src/filters/renderer/VideoRenderers/AllocatorCommon7.cpp
index 04f9f44ee..9853d6170 100644
--- a/src/filters/renderer/VideoRenderers/AllocatorCommon7.cpp
+++ b/src/filters/renderer/VideoRenderers/AllocatorCommon7.cpp
@@ -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.
*
@@ -48,7 +48,7 @@ HRESULT CreateAP7(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppA
{
CheckPointer(ppAP, E_POINTER);
- *ppAP = NULL;
+ *ppAP = nullptr;
HRESULT hr = S_OK;
@@ -62,7 +62,7 @@ HRESULT CreateAP7(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppA
return E_FAIL;
}
- if (*ppAP == NULL) {
+ if (*ppAP == nullptr) {
return E_OUTOFMEMORY;
}
@@ -70,7 +70,7 @@ HRESULT CreateAP7(const CLSID& clsid, HWND hWnd, ISubPicAllocatorPresenter** ppA
if (FAILED(hr)) {
(*ppAP)->Release();
- *ppAP = NULL;
+ *ppAP = nullptr;
}
return hr;
diff --git a/src/filters/renderer/VideoRenderers/D3DFont.cpp b/src/filters/renderer/VideoRenderers/D3DFont.cpp
index 42d25e665..5d32b8edc 100644
--- a/src/filters/renderer/VideoRenderers/D3DFont.cpp
+++ b/src/filters/renderer/VideoRenderers/D3DFont.cpp
@@ -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.
*
@@ -82,12 +82,12 @@ CD3DFont::CD3DFont(const TCHAR* strFontName, DWORD dwHeight, DWORD dwFlags)
m_dwFontFlags = dwFlags;
m_dwSpacing = 0;
- m_pd3dDevice = NULL;
- m_pTexture = NULL;
- m_pVB = NULL;
+ m_pd3dDevice = nullptr;
+ m_pTexture = nullptr;
+ m_pVB = nullptr;
- m_pStateBlockSaved = NULL;
- m_pStateBlockDrawText = NULL;
+ m_pStateBlockSaved = nullptr;
+ m_pStateBlockDrawText = nullptr;
}
@@ -123,7 +123,7 @@ HRESULT CD3DFont::CreateGDIFont(HDC hDC, HFONT* pFont)
CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
VARIABLE_PITCH, m_strFontName);
- if (*pFont == NULL) {
+ if (*pFont == nullptr) {
return E_FAIL;
}
@@ -172,7 +172,7 @@ HRESULT CD3DFont::PaintAlphabet(HDC hDC, BOOL bMeasureOnly)
if (!bMeasureOnly) {
// Perform the actual drawing
- if (0 == ExtTextOut(hDC, x + 0, y + 0, ETO_OPAQUE, NULL, str, 1, NULL)) {
+ if (0 == ExtTextOut(hDC, x + 0, y + 0, ETO_OPAQUE, nullptr, str, 1, nullptr)) {
return E_FAIL;
}
@@ -198,11 +198,11 @@ HRESULT CD3DFont::PaintAlphabet(HDC hDC, BOOL bMeasureOnly)
HRESULT CD3DFont::InitDeviceObjects(LPDIRECT3DDEVICE9 pd3dDevice)
{
HRESULT hr = S_OK;
- HFONT hFont = NULL;
- HFONT hFontOld = NULL;
- HDC hDC = NULL;
- HBITMAP hbmBitmap = NULL;
- HGDIOBJ hbmOld = NULL;
+ HFONT hFont = nullptr;
+ HFONT hFontOld = nullptr;
+ HDC hDC = nullptr;
+ HBITMAP hbmBitmap = nullptr;
+ HGDIOBJ hbmOld = nullptr;
// Keep a local copy of the device
m_pd3dDevice = pd3dDevice;
@@ -211,7 +211,7 @@ HRESULT CD3DFont::InitDeviceObjects(LPDIRECT3DDEVICE9 pd3dDevice)
// required texture size is found to be larger than the device max
m_fTextScale = 1.0f;
- hDC = CreateCompatibleDC(NULL);
+ hDC = CreateCompatibleDC(nullptr);
SetMapMode(hDC, MM_TEXT);
hr = CreateGDIFont(hDC, &hFont);
@@ -270,7 +270,7 @@ HRESULT CD3DFont::InitDeviceObjects(LPDIRECT3DDEVICE9 pd3dDevice)
// Create a new texture for the font
hr = m_pd3dDevice->CreateTexture(m_dwTexWidth, m_dwTexHeight, 1,
0, D3DFMT_A4R4G4B4,
- D3DPOOL_MANAGED, &m_pTexture, NULL);
+ D3DPOOL_MANAGED, &m_pTexture, nullptr);
if (FAILED(hr)) {
goto LCleanReturn;
}
@@ -288,7 +288,7 @@ HRESULT CD3DFont::InitDeviceObjects(LPDIRECT3DDEVICE9 pd3dDevice)
// Create a bitmap for the font
hbmBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS,
- (void**)&pBitmapBits, NULL, 0);
+ (void**)&pBitmapBits, nullptr, 0);
hbmOld = SelectObject(hDC, hbmBitmap);
@@ -355,16 +355,16 @@ HRESULT CD3DFont::RestoreDeviceObjects()
int vertexSize = max(sizeof(FONT2DVERTEX), sizeof(FONT3DVERTEX));
if (FAILED(hr = m_pd3dDevice->CreateVertexBuffer(MAX_NUM_VERTICES * vertexSize,
D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, 0,
- D3DPOOL_DEFAULT, &m_pVB, NULL))) {
+ D3DPOOL_DEFAULT, &m_pVB, nullptr))) {
return hr;
}
bool bSupportsAlphaBlend = true;
- LPDIRECT3D9 pd3d9 = NULL;
+ LPDIRECT3D9 pd3d9 = nullptr;
if (SUCCEEDED(m_pd3dDevice->GetDirect3D(&pd3d9))) {
D3DCAPS9 Caps;
D3DDISPLAYMODE Mode;
- LPDIRECT3DSURFACE9 pSurf = NULL;
+ LPDIRECT3DSURFACE9 pSurf = nullptr;
D3DSURFACE_DESC Desc;
m_pd3dDevice->GetDeviceCaps(&Caps);
m_pd3dDevice->GetDisplayMode(0, &Mode);
@@ -460,7 +460,7 @@ HRESULT CD3DFont::InvalidateDeviceObjects()
HRESULT CD3DFont::DeleteDeviceObjects()
{
SAFE_RELEASE(m_pTexture);
- m_pd3dDevice = NULL;
+ m_pd3dDevice = nullptr;
return S_OK;
}
@@ -473,7 +473,7 @@ HRESULT CD3DFont::DeleteDeviceObjects()
//-----------------------------------------------------------------------------
HRESULT CD3DFont::GetTextExtent(const TCHAR* strText, SIZE* pSize)
{
- if (NULL == strText || NULL == pSize) {
+ if (nullptr == strText || nullptr == pSize) {
return E_FAIL;
}
@@ -523,7 +523,7 @@ HRESULT CD3DFont::DrawTextScaled(float x, float y, float z,
float fXScale, float fYScale, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags)
{
- if (m_pd3dDevice == NULL) {
+ if (m_pd3dDevice == nullptr) {
return E_FAIL;
}
@@ -531,7 +531,7 @@ HRESULT CD3DFont::DrawTextScaled(float x, float y, float z,
m_pStateBlockSaved->Capture();
m_pStateBlockDrawText->Apply();
m_pd3dDevice->SetFVF(D3DFVF_FONT2DVERTEX);
- m_pd3dDevice->SetPixelShader(NULL);
+ m_pd3dDevice->SetPixelShader(nullptr);
m_pd3dDevice->SetStreamSource(0, m_pVB, 0, sizeof(FONT2DVERTEX));
// Set filter states
@@ -653,7 +653,7 @@ HRESULT CD3DFont::DrawTextScaled(float x, float y, float z,
HRESULT CD3DFont::DrawText(float sx, float sy, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags)
{
- if (m_pd3dDevice == NULL) {
+ if (m_pd3dDevice == nullptr) {
return E_FAIL;
}
@@ -661,7 +661,7 @@ HRESULT CD3DFont::DrawText(float sx, float sy, DWORD dwColor,
m_pStateBlockSaved->Capture();
m_pStateBlockDrawText->Apply();
m_pd3dDevice->SetFVF(D3DFVF_FONT2DVERTEX);
- m_pd3dDevice->SetPixelShader(NULL);
+ m_pd3dDevice->SetPixelShader(nullptr);
m_pd3dDevice->SetStreamSource(0, m_pVB, 0, sizeof(FONT2DVERTEX));
// Set filter states
@@ -709,7 +709,7 @@ HRESULT CD3DFont::DrawText(float sx, float sy, DWORD dwColor,
float fStartX = sx;
// Fill vertex buffer
- FONT2DVERTEX* pVertices = NULL;
+ FONT2DVERTEX* pVertices = nullptr;
DWORD dwNumTriangles = 0;
m_pVB->Lock(0, 0, (void**)&pVertices, D3DLOCK_DISCARD);
@@ -746,7 +746,7 @@ HRESULT CD3DFont::DrawText(float sx, float sy, DWORD dwColor,
// Unlock, render, and relock the vertex buffer
m_pVB->Unlock();
m_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, dwNumTriangles);
- pVertices = NULL;
+ pVertices = nullptr;
m_pVB->Lock(0, 0, (void**)&pVertices, D3DLOCK_DISCARD);
dwNumTriangles = 0L;
}
@@ -774,7 +774,7 @@ HRESULT CD3DFont::DrawText(float sx, float sy, DWORD dwColor,
//-----------------------------------------------------------------------------
HRESULT CD3DFont::Render3DText(const TCHAR* strText, DWORD dwFlags)
{
- if (m_pd3dDevice == NULL) {
+ if (m_pd3dDevice == nullptr) {
return E_FAIL;
}
@@ -782,7 +782,7 @@ HRESULT CD3DFont::Render3DText(const TCHAR* strText, DWORD dwFlags)
m_pStateBlockSaved->Capture();
m_pStateBlockDrawText->Apply();
m_pd3dDevice->SetFVF(D3DFVF_FONT3DVERTEX);
- m_pd3dDevice->SetPixelShader(NULL);
+ m_pd3dDevice->SetPixelShader(nullptr);
m_pd3dDevice->SetStreamSource(0, m_pVB, 0, sizeof(FONT3DVERTEX));
// Set filter states
diff --git a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
index 2a26c5a0b..77d167b19 100644
--- a/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX7AllocatorPresenter.cpp
@@ -93,7 +93,7 @@ static HRESULT TextureBlt(IDirect3DDevice7* pD3DDev, IDirectDrawSurface7* pTextu
//
- pD3DDev->SetTexture(0, NULL);
+ pD3DDev->SetTexture(0, nullptr);
return S_OK;
}
@@ -106,26 +106,26 @@ typedef HRESULT(WINAPI* DirectDrawCreateExPtr)(GUID FAR* lpGuid, LPVOID* lplpDD
CDX7AllocatorPresenter::CDX7AllocatorPresenter(HWND hWnd, HRESULT& hr)
- : CSubPicAllocatorPresenterImpl(hWnd, hr, NULL)
+ : CSubPicAllocatorPresenterImpl(hWnd, hr, nullptr)
, m_ScreenSize(0, 0)
- , m_hDDrawLib(NULL)
+ , m_hDDrawLib(nullptr)
{
if (FAILED(hr)) {
return;
}
- DirectDrawCreateExPtr pDirectDrawCreateEx = NULL;
+ DirectDrawCreateExPtr pDirectDrawCreateEx = nullptr;
m_hDDrawLib = LoadLibrary(_T("ddraw.dll"));
if (m_hDDrawLib) {
pDirectDrawCreateEx = (DirectDrawCreateExPtr)GetProcAddress(m_hDDrawLib, "DirectDrawCreateEx");
}
- if (pDirectDrawCreateEx == NULL) {
+ if (pDirectDrawCreateEx == nullptr) {
hr = E_FAIL;
return;
}
- if (FAILED(hr = pDirectDrawCreateEx(NULL, (VOID**)&m_pDD, IID_IDirectDraw7, NULL))
+ if (FAILED(hr = pDirectDrawCreateEx(nullptr, (VOID**)&m_pDD, IID_IDirectDraw7, nullptr))
|| FAILED(hr = m_pDD->SetCooperativeLevel(AfxGetMainWnd()->GetSafeHwnd(), DDSCL_NORMAL))) {
return;
}
@@ -144,13 +144,13 @@ CDX7AllocatorPresenter::CDX7AllocatorPresenter(HWND hWnd, HRESULT& hr)
CDX7AllocatorPresenter::~CDX7AllocatorPresenter()
{
// Release the interfaces before releasing the library
- m_pPrimary = NULL;
- m_pBackBuffer = NULL;
- m_pVideoTexture = NULL;
- m_pVideoSurface = NULL;
- m_pD3DDev = NULL;
+ m_pPrimary = nullptr;
+ m_pBackBuffer = nullptr;
+ m_pVideoTexture = nullptr;
+ m_pVideoSurface = nullptr;
+ m_pD3DDev = nullptr;
m_pD3D.Release();
- m_pDD = NULL;
+ m_pDD = nullptr;
if (m_hDDrawLib) {
FreeLibrary(m_hDDrawLib);
}
@@ -158,9 +158,9 @@ CDX7AllocatorPresenter::~CDX7AllocatorPresenter()
HRESULT CDX7AllocatorPresenter::CreateDevice()
{
- m_pD3DDev = NULL;
- m_pPrimary = NULL;
- m_pBackBuffer = NULL;
+ m_pD3DDev = nullptr;
+ m_pPrimary = nullptr;
+ m_pBackBuffer = nullptr;
DDSURFACEDESC2 ddsd;
INITDDSTRUCT(ddsd);
@@ -178,12 +178,12 @@ HRESULT CDX7AllocatorPresenter::CreateDevice()
INITDDSTRUCT(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- if (FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pPrimary, NULL))) {
+ if (FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pPrimary, nullptr))) {
return hr;
}
CComPtr<IDirectDrawClipper> pcClipper;
- if (FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, NULL))) {
+ if (FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, nullptr))) {
return hr;
}
pcClipper->SetHWnd(0, m_hWnd);
@@ -196,12 +196,12 @@ HRESULT CDX7AllocatorPresenter::CreateDevice()
ddsd.ddsCaps.dwCaps = /*DDSCAPS_OFFSCREENPLAIN |*/ DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE;
ddsd.dwWidth = m_ScreenSize.cx;
ddsd.dwHeight = m_ScreenSize.cy;
- if (FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pBackBuffer, NULL))) {
+ if (FAILED(hr = m_pDD->CreateSurface(&ddsd, &m_pBackBuffer, nullptr))) {
return hr;
}
- pcClipper = NULL;
- if (FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, NULL))) {
+ pcClipper = nullptr;
+ if (FAILED(hr = m_pDD->CreateClipper(0, &pcClipper, nullptr))) {
return hr;
}
BYTE rgnDataBuffer[1024];
@@ -289,8 +289,8 @@ HRESULT CDX7AllocatorPresenter::AllocSurfaces()
const CRenderersSettings& s = GetRenderersSettings();
- m_pVideoTexture = NULL;
- m_pVideoSurface = NULL;
+ m_pVideoTexture = nullptr;
+ m_pVideoSurface = nullptr;
DDSURFACEDESC2 ddsd;
INITDDSTRUCT(ddsd);
@@ -311,7 +311,7 @@ HRESULT CDX7AllocatorPresenter::AllocSurfaces()
//ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000;
}
- HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, NULL);
+ HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, nullptr);
if (FAILED(hr)) {
// FIXME: eh, dx9 has no problem creating a 32bpp surface under a 16bpp desktop, but dx7 fails here (textures are ok)
DDSURFACEDESC2 ddsd2;
@@ -323,7 +323,7 @@ HRESULT CDX7AllocatorPresenter::AllocSurfaces()
ddsd.ddpfPixelFormat.dwRBitMask = 0x0000F800;
ddsd.ddpfPixelFormat.dwGBitMask = 0x000007E0;
ddsd.ddpfPixelFormat.dwBBitMask = 0x0000001F;
- hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, NULL);
+ hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurface, nullptr);
}
if (FAILED(hr)) {
@@ -338,7 +338,7 @@ HRESULT CDX7AllocatorPresenter::AllocSurfaces()
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- hr = m_pVideoSurface->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ hr = m_pVideoSurface->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
return S_OK;
}
@@ -347,8 +347,8 @@ void CDX7AllocatorPresenter::DeleteSurfaces()
{
CAutoLock cAutoLock(this);
- m_pVideoTexture = NULL;
- m_pVideoSurface = NULL;
+ m_pVideoTexture = nullptr;
+ m_pVideoSurface = nullptr;
}
// ISubPicAllocatorPresenter
@@ -393,7 +393,7 @@ STDMETHODIMP_(bool) CDX7AllocatorPresenter::Paint(bool fAll)
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- hr = m_pBackBuffer->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ hr = m_pBackBuffer->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
// paint the video on the backbuffer
@@ -403,7 +403,7 @@ STDMETHODIMP_(bool) CDX7AllocatorPresenter::Paint(bool fAll)
Transform(rDstVid, v);
hr = TextureBlt(m_pD3DDev, m_pVideoTexture, v, rSrcVid);
} else {
- hr = m_pBackBuffer->Blt(rDstVid, m_pVideoSurface, rSrcVid, DDBLT_WAIT, NULL);
+ hr = m_pBackBuffer->Blt(rDstVid, m_pVideoSurface, rSrcVid, DDBLT_WAIT, nullptr);
}
}
@@ -414,11 +414,11 @@ STDMETHODIMP_(bool) CDX7AllocatorPresenter::Paint(bool fAll)
// wait vsync
- m_pDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL);
+ m_pDD->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, nullptr);
// blt to the primary surface
- hr = m_pPrimary->Blt(rDstPri, m_pBackBuffer, rSrcPri, DDBLT_WAIT, NULL);
+ hr = m_pPrimary->Blt(rDstPri, m_pBackBuffer, rSrcPri, DDBLT_WAIT, nullptr);
if (hr == DDERR_SURFACELOST) {
m_bPendingResetDevice = true;
@@ -485,7 +485,7 @@ STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
*size = required;
INITDDSTRUCT(ddsd);
- if (FAILED(hr = m_pVideoSurface->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_READONLY | DDLOCK_NOSYSLOCK, NULL))) {
+ if (FAILED(hr = m_pVideoSurface->Lock(nullptr, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_READONLY | DDLOCK_NOSYSLOCK, nullptr))) {
// TODO
return hr;
}
@@ -504,14 +504,14 @@ STDMETHODIMP CDX7AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
(BYTE*)(bih + 1), bih->biWidth * bih->biBitCount >> 3, bih->biBitCount,
(BYTE*)ddsd.lpSurface + ddsd.lPitch * (ddsd.dwHeight - 1), -(int)ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount);
- m_pVideoSurface->Unlock(NULL);
+ m_pVideoSurface->Unlock(nullptr);
/*
BitBltFromRGBToRGB(
w, h,
(BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount,
(BYTE*)bm.bmBits, bm.bmWidthBytes, bm.bmBitsPixel);
- m_pVideoSurfaceOff->Unlock(NULL);
+ m_pVideoSurfaceOff->Unlock(nullptr);
fOk = true;
}
*/
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
index f2104f3f9..1be320e31 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
@@ -61,7 +61,7 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
, m_TextScale(1.0)
, m_MainThreadId(0)
, m_bNeedCheckSample(true)
- , m_pDirectDraw(NULL)
+ , m_pDirectDraw(nullptr)
, m_bIsFullscreen(bFullscreen)
, m_Decoder(_T(""))
, m_nFrameType(PICT_NONE)
@@ -73,11 +73,11 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
return;
}
- m_pD3DXLoadSurfaceFromMemory = NULL;
- m_pD3DXLoadSurfaceFromSurface = NULL;
- m_pD3DXCreateLine = NULL;
- m_pD3DXCreateFont = NULL;
- m_pD3DXCreateSprite = NULL;
+ m_pD3DXLoadSurfaceFromMemory = nullptr;
+ m_pD3DXLoadSurfaceFromSurface = nullptr;
+ m_pD3DXCreateLine = nullptr;
+ m_pD3DXCreateFont = nullptr;
+ m_pD3DXCreateSprite = nullptr;
hDll = GetRenderersData()->GetD3X9Dll();
if (hDll) {
(FARPROC&)m_pD3DXLoadSurfaceFromMemory = GetProcAddress(hDll, "D3DXLoadSurfaceFromMemory");
@@ -91,15 +91,15 @@ CDX9AllocatorPresenter::CDX9AllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
_Error += _T(" release or newer in order for MPC-HC to function properly.\n");
}
- m_pDwmIsCompositionEnabled = NULL;
- m_pDwmEnableComposition = NULL;
+ m_pDwmIsCompositionEnabled = nullptr;
+ m_pDwmEnableComposition = nullptr;
m_hDWMAPI = LoadLibrary(L"dwmapi.dll");
if (m_hDWMAPI) {
(FARPROC&)m_pDwmIsCompositionEnabled = GetProcAddress(m_hDWMAPI, "DwmIsCompositionEnabled");
(FARPROC&)m_pDwmEnableComposition = GetProcAddress(m_hDWMAPI, "DwmEnableComposition");
}
- m_pDirect3DCreate9Ex = NULL;
+ m_pDirect3DCreate9Ex = nullptr;
m_hD3D9 = LoadLibrary(L"d3d9.dll");
#ifndef DISABLE_USING_D3D9EX
if (m_hD3D9) {
@@ -172,22 +172,22 @@ CDX9AllocatorPresenter::~CDX9AllocatorPresenter()
}
}
- m_pFont = NULL;
- m_pLine = NULL;
- m_pD3DDev = NULL;
- m_pD3DDevEx = NULL;
+ m_pFont = nullptr;
+ m_pLine = nullptr;
+ m_pD3DDev = nullptr;
+ m_pD3DDevEx = nullptr;
CleanupRenderingEngine();
- m_pD3D = NULL;
- m_pD3DEx = NULL;
+ m_pD3D = nullptr;
+ m_pD3DEx = nullptr;
if (m_hDWMAPI) {
FreeLibrary(m_hDWMAPI);
- m_hDWMAPI = NULL;
+ m_hDWMAPI = nullptr;
}
if (m_hD3D9) {
FreeLibrary(m_hD3D9);
- m_hD3D9 = NULL;
+ m_hD3D9 = nullptr;
}
}
@@ -487,9 +487,9 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
ZeroMemory(m_ClockChangeHistory, sizeof(m_ClockChangeHistory));
m_ClockTimeChangeHistoryPos = 0;
- m_pD3DDev = NULL;
- m_pD3DDevEx = NULL;
- m_pDirectDraw = NULL;
+ m_pD3DDev = nullptr;
+ m_pD3DDevEx = nullptr;
+ m_pDirectDraw = nullptr;
CleanupRenderingEngine();
@@ -538,7 +538,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
//#define ENABLE_DDRAWSYNC
#ifdef ENABLE_DDRAWSYNC
- hr = DirectDrawCreate(NULL, &m_pDirectDraw, NULL);
+ hr = DirectDrawCreate(nullptr, &m_pDirectDraw, nullptr);
if (hr == S_OK) {
hr = m_pDirectDraw->SetCooperativeLevel(m_hWnd, DDSCL_NORMAL);
}
@@ -601,7 +601,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
}
m_D3DDevExError = L"No m_pD3DEx";
if (m_pD3DEx) {
- m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, NULL);
+ m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, nullptr);
DisplayMode.Format = pp.BackBufferFormat;
m_ScreenSize.SetSize(DisplayMode.Width, DisplayMode.Height);
@@ -653,7 +653,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
}
if (m_pD3DEx) {
- m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, NULL);
+ m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, nullptr);
m_ScreenSize.SetSize(DisplayMode.Width, DisplayMode.Height);
m_RefreshRate = DisplayMode.RefreshRate;
pp.BackBufferWidth = m_ScreenSize.cx;
@@ -664,7 +664,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
hr = m_pD3DEx->CreateDeviceEx(
m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
GetVertexProcessing() | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_ENABLE_PRESENTSTATS, //D3DCREATE_MANAGED
- &pp, NULL, &m_pD3DDevEx);
+ &pp, nullptr, &m_pD3DDevEx);
if (m_pD3DDevEx) {
m_pD3DDev = m_pD3DDevEx;
m_DisplayType = DisplayMode.Format;
@@ -785,7 +785,7 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
m_pSubPicQueue->SetSubPicProvider(pSubPicProvider);
}
- m_pFont = NULL;
+ m_pFont = nullptr;
if (m_pD3DXCreateFont) {
int MinSize = 1600;
int CurrentSize = min(m_ScreenSize.cx, MinSize);
@@ -806,14 +806,14 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString& _Error)
}
- m_pSprite = NULL;
+ m_pSprite = nullptr;
if (m_pD3DXCreateSprite) {
m_pD3DXCreateSprite(m_pD3DDev, // D3D device
&m_pSprite);
}
- m_pLine = NULL;
+ m_pLine = nullptr;
if (m_pD3DXCreateLine) {
m_pD3DXCreateLine(m_pD3DDev, &m_pLine);
}
@@ -841,7 +841,7 @@ void CDX9AllocatorPresenter::DeleteSurfaces()
UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bGetAdapter)
{
- if (m_hWnd == NULL || pD3D == NULL) {
+ if (m_hWnd == nullptr || pD3D == nullptr) {
return D3DADAPTER_DEFAULT;
}
@@ -863,7 +863,7 @@ UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bGetAdapter)
}
HMONITOR hMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
- if (hMonitor == NULL) {
+ if (hMonitor == nullptr) {
return D3DADAPTER_DEFAULT;
}
@@ -1304,7 +1304,7 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll)
// Clear the backbuffer
m_pD3DDev->SetRenderTarget(0, pBackBuffer);
- hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0);
+ hr = m_pD3DDev->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1.0f, 0);
CRect rSrcVid(CPoint(0, 0), GetVisibleVideoSize());
CRect rDstVid(m_VideoRect);
@@ -1337,28 +1337,28 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll)
if (m_VMR9AlphaBitmap.dwFlags & VMRBITMAP_UPDATE) {
CAutoLock BitMapLock(&m_VMR9AlphaBitmapLock);
CRect rcSrc(m_VMR9AlphaBitmap.rSrc);
- m_pOSDTexture = NULL;
- m_pOSDSurface = NULL;
+ m_pOSDTexture = nullptr;
+ m_pOSDSurface = nullptr;
if ((m_VMR9AlphaBitmap.dwFlags & VMRBITMAP_DISABLE) == 0 && (BYTE*)m_VMR9AlphaBitmapData) {
- if ((m_pD3DXLoadSurfaceFromMemory != NULL) &&
+ if ((m_pD3DXLoadSurfaceFromMemory != nullptr) &&
SUCCEEDED(hr = m_pD3DDev->CreateTexture(rcSrc.Width(), rcSrc.Height(), 1,
D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
- D3DPOOL_DEFAULT, &m_pOSDTexture, NULL))) {
+ D3DPOOL_DEFAULT, &m_pOSDTexture, nullptr))) {
if (SUCCEEDED(hr = m_pOSDTexture->GetSurfaceLevel(0, &m_pOSDSurface))) {
hr = m_pD3DXLoadSurfaceFromMemory(m_pOSDSurface,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
(BYTE*)m_VMR9AlphaBitmapData,
D3DFMT_A8R8G8B8,
m_VMR9AlphaBitmapWidthBytes,
- NULL,
+ nullptr,
&m_VMR9AlphaBitmapRect,
D3DX_FILTER_NONE,
m_VMR9AlphaBitmap.clrSrcKey);
}
if (FAILED(hr)) {
- m_pOSDTexture = NULL;
- m_pOSDSurface = NULL;
+ m_pOSDTexture = nullptr;
+ m_pOSDSurface = nullptr;
}
}
}
@@ -1448,15 +1448,15 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll)
LONGLONG llPerf = pApp->GetPerfCounter();
if (m_pD3DDevEx) {
if (m_bIsFullscreen) {
- hr = m_pD3DDevEx->PresentEx(NULL, NULL, NULL, NULL, NULL);
+ hr = m_pD3DDevEx->PresentEx(nullptr, nullptr, nullptr, nullptr, 0);
} else {
- hr = m_pD3DDevEx->PresentEx(rSrcPri, rDstPri, NULL, NULL, NULL);
+ hr = m_pD3DDevEx->PresentEx(rSrcPri, rDstPri, nullptr, nullptr, 0);
}
} else {
if (m_bIsFullscreen) {
- hr = m_pD3DDev->Present(NULL, NULL, NULL, NULL);
+ hr = m_pD3DDev->Present(nullptr, nullptr, nullptr, nullptr);
} else {
- hr = m_pD3DDev->Present(rSrcPri, rDstPri, NULL, NULL);
+ hr = m_pD3DDev->Present(rSrcPri, rDstPri, nullptr, nullptr);
}
}
// Issue an End event
@@ -1644,7 +1644,7 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::ResetDevice()
if (FAILED(hr = CreateDevice(Error)) || FAILED(hr = AllocSurfaces())) {
// TODO: We should probably pause player
#ifdef _DEBUG
- Error += GetWindowsErrorMessage(hr, NULL);
+ Error += GetWindowsErrorMessage(hr, nullptr);
TRACE(_T("D3D Reset Error\n%ws\n\n"), Error.GetBuffer());
#endif
m_bDeviceResetRequested = false;
@@ -2119,26 +2119,26 @@ STDMETHODIMP CDX9AllocatorPresenter::GetDIB(BYTE* lpDib, DWORD* size)
CComPtr<IDirect3DSurface9> pSurface;
if (m_bFullFloatingPointProcessing || m_bHalfFloatingPointProcessing || m_bHighColorResolution) {
CComPtr<IDirect3DSurface9> fSurface = m_pVideoSurface[m_nCurSurface];
- if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fSurface, NULL))
- || FAILED(hr = m_pD3DXLoadSurfaceFromSurface(fSurface, NULL, NULL, m_pVideoSurface[m_nCurSurface], NULL, NULL, D3DX_DEFAULT, 0))) {
+ if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &fSurface, nullptr))
+ || FAILED(hr = m_pD3DXLoadSurfaceFromSurface(fSurface, nullptr, nullptr, m_pVideoSurface[m_nCurSurface], nullptr, nullptr, D3DX_DEFAULT, 0))) {
return hr;
}
pSurface = fSurface;
- if (FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
- pSurface = NULL;
- if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
+ if (FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
+ pSurface = nullptr;
+ if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &pSurface, nullptr))
|| FAILED(hr = m_pD3DDev->GetRenderTargetData(fSurface, pSurface))
- || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
+ || FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
return hr;
}
}
} else {
pSurface = m_pVideoSurface[m_nCurSurface];
- if (FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
- pSurface = NULL;
- if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
+ if (FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
+ pSurface = nullptr;
+ if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, nullptr))
|| FAILED(hr = m_pD3DDev->GetRenderTargetData(m_pVideoSurface[m_nCurSurface], pSurface))
- || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
+ || FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
return hr;
}
}
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
index cf08fc96a..f143d3c20 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
@@ -133,7 +133,7 @@ static HRESULT TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[4]
//
for (int i = 0; i < texcoords; i++) {
- pD3DDev->SetTexture(i, NULL);
+ pD3DDev->SetTexture(i, nullptr);
}
return S_OK;
@@ -150,7 +150,7 @@ CDX9RenderingEngine::CDX9RenderingEngine(HWND hWnd, HRESULT& hr, CString* _pErro
, m_CurrentAdapter(0)
{
HINSTANCE hDll = GetRenderersData()->GetD3X9Dll();
- m_bD3DX = hDll != NULL;
+ m_bD3DX = hDll != nullptr;
if (m_bD3DX) {
(FARPROC&)m_pD3DXFloat32To16Array = GetProcAddress(hDll, "D3DXFloat32To16Array");
@@ -173,7 +173,7 @@ void CDX9RenderingEngine::CleanupRenderingEngine()
m_pPSC.Free();
for (int i = 0; i < 4; i++) {
- m_pResizerPixelShaders[i] = NULL;
+ m_pResizerPixelShaders[i] = nullptr;
}
CleanupFinalPass();
@@ -181,17 +181,17 @@ void CDX9RenderingEngine::CleanupRenderingEngine()
POSITION pos = m_pCustomScreenSpacePixelShaders.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pCustomScreenSpacePixelShaders.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
pos = m_pCustomPixelShaders.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pCustomPixelShaders.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
for (int i = 0; i < 2; i++) {
- m_pTemporaryVideoTextures[i] = NULL;
- m_pTemporaryScreenSpaceTextures[i] = NULL;
+ m_pTemporaryVideoTextures[i] = nullptr;
+ m_pTemporaryScreenSpaceTextures[i] = nullptr;
}
}
@@ -205,7 +205,7 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
// Free previously allocated temporary video textures, because the native video size might have been changed!
for (int i = 0; i < 2; i++) {
- m_pTemporaryVideoTextures[i] = NULL;
+ m_pTemporaryVideoTextures[i] = nullptr;
}
if (settings.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D || settings.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) {
@@ -219,7 +219,7 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
m_SurfaceType,
D3DPOOL_DEFAULT,
&m_pVideoTexture[i],
- NULL))) {
+ nullptr))) {
return hr;
}
@@ -232,7 +232,7 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
m_RenderingPath = RENDERING_PATH_STRETCHRECT;
for (int i = 0; i < m_nNbDXSurface; i++) {
- m_pVideoTexture[i] = NULL;
+ m_pVideoTexture[i] = nullptr;
}
} else {
m_RenderingPath = RENDERING_PATH_DRAW;
@@ -243,12 +243,12 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(
m_NativeVideoSize.cx, m_NativeVideoSize.cy,
m_SurfaceType,
- D3DPOOL_DEFAULT, &m_pVideoSurface[m_nCurSurface], NULL))) {
+ D3DPOOL_DEFAULT, &m_pVideoSurface[m_nCurSurface], nullptr))) {
return hr;
}
}
- hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1, 0);
+ hr = m_pD3DDev->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1, 0);
return S_OK;
}
@@ -256,8 +256,8 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
void CDX9RenderingEngine::FreeVideoSurfaces()
{
for (int i = 0; i < m_nNbDXSurface; i++) {
- m_pVideoTexture[i] = NULL;
- m_pVideoSurface[i] = NULL;
+ m_pVideoTexture[i] = nullptr;
+ m_pVideoSurface[i] = nullptr;
}
}
@@ -421,7 +421,7 @@ HRESULT CDX9RenderingEngine::RenderVideoDrawPath(IDirect3DSurface9* pRenderTarge
hr = BeginScreenSpacePass();
if (m_ScreenSpacePassCount > 0) {
- hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0);
+ hr = m_pD3DDev->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1.0f, 0);
}
if (srcRect.Size() != destRect.Size()) {
@@ -475,7 +475,7 @@ HRESULT CDX9RenderingEngine::RenderVideoDrawPath(IDirect3DSurface9* pRenderTarge
hr = FinalPass(m_pTemporaryScreenSpaceTextures[m_ScreenSpacePassSrc]);
}
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
return hr;
}
@@ -508,7 +508,7 @@ HRESULT CDX9RenderingEngine::InitTemporaryVideoTextures(int count)
HRESULT hr = S_OK;
for (int i = 0; i < count; i++) {
- if (m_pTemporaryVideoTextures[i] == NULL) {
+ if (m_pTemporaryVideoTextures[i] == nullptr) {
hr = m_pD3DDev->CreateTexture(
m_NativeVideoSize.cx,
m_NativeVideoSize.cy,
@@ -517,12 +517,12 @@ HRESULT CDX9RenderingEngine::InitTemporaryVideoTextures(int count)
m_SurfaceType,
D3DPOOL_DEFAULT,
&m_pTemporaryVideoTextures[i],
- NULL);
+ nullptr);
if (FAILED(hr)) {
// Free all textures
for (int j = 0; j < 2; j++) {
- m_pTemporaryVideoTextures[j] = NULL;
+ m_pTemporaryVideoTextures[j] = nullptr;
}
return hr;
@@ -532,7 +532,7 @@ HRESULT CDX9RenderingEngine::InitTemporaryVideoTextures(int count)
// Free unnecessary textures
for (int i = count; i < 2; i++) {
- m_pTemporaryVideoTextures[i] = NULL;
+ m_pTemporaryVideoTextures[i] = nullptr;
}
return hr;
@@ -560,7 +560,7 @@ HRESULT CDX9RenderingEngine::InitTemporaryScreenSpaceTextures(int count)
HRESULT hr = S_OK;
for (int i = 0; i < count; i++) {
- if (m_pTemporaryScreenSpaceTextures[i] == NULL) {
+ if (m_pTemporaryScreenSpaceTextures[i] == nullptr) {
m_TemporaryScreenSpaceTextureSize = CSize(min(m_ScreenSize.cx, (int)m_Caps.MaxTextureWidth),
min(max(m_ScreenSize.cy, m_NativeVideoSize.cy), (int)m_Caps.MaxTextureHeight));
hr = m_pD3DDev->CreateTexture(
@@ -571,12 +571,12 @@ HRESULT CDX9RenderingEngine::InitTemporaryScreenSpaceTextures(int count)
m_SurfaceType,
D3DPOOL_DEFAULT,
&m_pTemporaryScreenSpaceTextures[i],
- NULL);
+ nullptr);
if (FAILED(hr)) {
// Free all textures
for (int j = 0; j < 2; j++) {
- m_pTemporaryScreenSpaceTextures[j] = NULL;
+ m_pTemporaryScreenSpaceTextures[j] = nullptr;
}
return hr;
@@ -586,7 +586,7 @@ HRESULT CDX9RenderingEngine::InitTemporaryScreenSpaceTextures(int count)
// Free unnecessary textures
for (int i = count; i < 2; i++) {
- m_pTemporaryScreenSpaceTextures[i] = NULL;
+ m_pTemporaryScreenSpaceTextures[i] = nullptr;
}
return hr;
@@ -644,7 +644,7 @@ HRESULT CDX9RenderingEngine::InitResizers(float bicubicA)
m_BicubicA = bicubicA;
for (int i = 0; i < _countof(m_pResizerPixelShaders); i++) {
- m_pResizerPixelShaders[i] = NULL;
+ m_pResizerPixelShaders[i] = nullptr;
}
if (m_Caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) {
@@ -725,7 +725,7 @@ HRESULT CDX9RenderingEngine::TextureResize(IDirect3DTexture9* pTexture, Vector d
AdjustQuad(v, 0, 0);
hr = m_pD3DDev->SetTexture(0, pTexture);
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
hr = TextureBlt(m_pD3DDev, v, filter);
return hr;
@@ -981,8 +981,8 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
// Initial cleanup
- m_pLut3DTexture = NULL;
- m_pFinalPixelShader = NULL;
+ m_pLut3DTexture = nullptr;
+ m_pFinalPixelShader = nullptr;
if (!m_pDitherTexture) {
// Create the dither texture
@@ -992,7 +992,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
D3DFMT_A16B16G16R16F,
D3DPOOL_DEFAULT,
&m_pDitherTexture,
- NULL);
+ nullptr);
if (FAILED(hr)) {
CleanupFinalPass();
@@ -1000,7 +1000,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
D3DLOCKED_RECT lockedRect;
- hr = m_pDitherTexture->LockRect(0, &lockedRect, NULL, D3DLOCK_DISCARD);
+ hr = m_pDitherTexture->LockRect(0, &lockedRect, nullptr, D3DLOCK_DISCARD);
if (FAILED(hr)) {
CleanupFinalPass();
return hr;
@@ -1031,9 +1031,9 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
TCHAR* iccProfilePath = 0;
HDC hDC = GetDC(m_hWnd);
- if (hDC != NULL) {
+ if (hDC != nullptr) {
DWORD icmProfilePathSize = 0;
- GetICMProfile(hDC, &icmProfilePathSize, NULL);
+ GetICMProfile(hDC, &icmProfilePathSize, nullptr);
iccProfilePath = DEBUG_NEW TCHAR[icmProfilePathSize];
if (!GetICMProfile(hDC, &icmProfilePathSize, iccProfilePath)) {
delete [] iccProfilePath;
@@ -1053,7 +1053,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
D3DFMT_A16B16G16R16F,
D3DPOOL_DEFAULT,
&m_pLut3DTexture,
- NULL);
+ nullptr);
if (FAILED(hr)) {
delete [] iccProfilePath;
@@ -1079,7 +1079,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
m_pD3DXFloat32To16Array(&oneFloat16, &oneFloat32, 1);
D3DLOCKED_BOX lockedBox;
- hr = m_pLut3DTexture->LockBox(0, &lockedBox, NULL, D3DLOCK_DISCARD);
+ hr = m_pLut3DTexture->LockBox(0, &lockedBox, nullptr, D3DLOCK_DISCARD);
if (FAILED(hr)) {
delete [] lut3DFloat16;
CleanupFinalPass();
@@ -1164,9 +1164,9 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
void CDX9RenderingEngine::CleanupFinalPass()
{
m_bFinalPass = false;
- m_pDitherTexture = NULL;
- m_pLut3DTexture = NULL;
- m_pFinalPixelShader = NULL;
+ m_pDitherTexture = nullptr;
+ m_pLut3DTexture = nullptr;
+ m_pFinalPixelShader = nullptr;
}
HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3D)
@@ -1301,7 +1301,7 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
cmsHPROFILE hInputProfile = cmsCreateRGBProfile(&whitePoint, &primaries, transferFunctionRGB);
cmsFreeToneCurve(transferFunction);
- if (hInputProfile == NULL) {
+ if (hInputProfile == nullptr) {
return E_FAIL;
}
@@ -1320,7 +1320,7 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
hOutputProfile = cmsCreate_sRGBProfile();
}
- if (hOutputProfile == NULL) {
+ if (hOutputProfile == nullptr) {
if (profilePath != 0) {
fclose(outputProfileStream);
}
@@ -1340,7 +1340,7 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
cmsCloseProfile(hInputProfile);
- if (hTransform == NULL) {
+ if (hTransform == nullptr) {
return E_FAIL;
}
@@ -1440,10 +1440,10 @@ HRESULT CDX9RenderingEngine::FinalPass(IDirect3DTexture9* pTexture)
hr = TextureBlt(m_pD3DDev, v, D3DTEXF_POINT);
- hr = m_pD3DDev->SetTexture(1, NULL);
+ hr = m_pD3DDev->SetTexture(1, nullptr);
if (m_bColorManagement) {
- hr = m_pD3DDev->SetTexture(2, NULL);
+ hr = m_pD3DDev->SetTexture(2, nullptr);
}
return hr;
@@ -1645,14 +1645,14 @@ HRESULT CDX9RenderingEngine::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9*
*///
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
hr = m_pD3DDev->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1);
hr = m_pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(pVertices[0]));
//
- m_pD3DDev->SetTexture(0, NULL);
+ m_pD3DDev->SetTexture(0, nullptr);
m_pD3DDev->SetRenderState(D3DRS_ALPHABLENDENABLE, abe);
m_pD3DDev->SetRenderState(D3DRS_SRCBLEND, sb);
@@ -1672,7 +1672,7 @@ HRESULT CDX9RenderingEngine::SetCustomPixelShader(LPCSTR pSrcData, LPCSTR pTarge
if (!pSrcData && !pTarget) {
pPixelShaders->RemoveAll();
- m_pD3DDev->SetPixelShader(NULL);
+ m_pD3DDev->SetPixelShader(nullptr);
return S_OK;
}
diff --git a/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
index edbc1ecab..09c40b998 100644
--- a/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DXRAllocatorPresenter.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -47,13 +47,13 @@ CDXRAllocatorPresenter::~CDXRAllocatorPresenter()
{
if (m_pSRCB) {
// nasty, but we have to let it know about our death somehow
- ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(NULL);
+ ((CSubRenderCallback*)(ISubRenderCallback*)m_pSRCB)->SetDXRAP(nullptr);
}
// the order is important here
- m_pSubPicQueue = NULL;
- m_pAllocator = NULL;
- m_pDXR = NULL;
+ m_pSubPicQueue = nullptr;
+ m_pAllocator = nullptr;
+ m_pDXR = nullptr;
}
STDMETHODIMP CDXRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
@@ -173,13 +173,13 @@ STDMETHODIMP CDXRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
CComQIPtr<ISubRender> pSR = m_pDXR;
if (!pSR) {
- m_pDXR = NULL;
+ m_pDXR = nullptr;
return E_FAIL;
}
m_pSRCB = DEBUG_NEW CSubRenderCallback(this);
if (FAILED(pSR->SetCallback(m_pSRCB))) {
- m_pDXR = NULL;
+ m_pDXR = nullptr;
return E_FAIL;
}
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
index e3f99cda6..991036997 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
@@ -66,9 +66,9 @@ using namespace DSObjects;
CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
: CDX9AllocatorPresenter(hWnd, bFullscreen, hr, true, _Error)
- , m_hDXVA2Lib(NULL)
- , m_hEVRLib(NULL)
- , m_hAVRTLib(NULL)
+ , m_hDXVA2Lib(nullptr)
+ , m_hEVRLib(nullptr)
+ , m_hAVRTLib(nullptr)
{
const CRenderersSettings& s = GetRenderersSettings();
@@ -91,13 +91,13 @@ CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
// Load EVR specific DLLs
m_hDXVA2Lib = LoadLibrary(L"dxva2.dll");
- pfDXVA2CreateDirect3DDeviceManager9 = m_hDXVA2Lib ? (PTR_DXVA2CreateDirect3DDeviceManager9) GetProcAddress(m_hDXVA2Lib, "DXVA2CreateDirect3DDeviceManager9") : NULL;
+ pfDXVA2CreateDirect3DDeviceManager9 = m_hDXVA2Lib ? (PTR_DXVA2CreateDirect3DDeviceManager9) GetProcAddress(m_hDXVA2Lib, "DXVA2CreateDirect3DDeviceManager9") : nullptr;
// Load EVR functions
m_hEVRLib = LoadLibrary(L"evr.dll");
- pfMFCreateDXSurfaceBuffer = m_hEVRLib ? (PTR_MFCreateDXSurfaceBuffer) GetProcAddress(m_hEVRLib, "MFCreateDXSurfaceBuffer") : NULL;
- pfMFCreateVideoSampleFromSurface = m_hEVRLib ? (PTR_MFCreateVideoSampleFromSurface) GetProcAddress(m_hEVRLib, "MFCreateVideoSampleFromSurface") : NULL;
- pfMFCreateVideoMediaType = m_hEVRLib ? (PTR_MFCreateVideoMediaType) GetProcAddress(m_hEVRLib, "MFCreateVideoMediaType") : NULL;
+ pfMFCreateDXSurfaceBuffer = m_hEVRLib ? (PTR_MFCreateDXSurfaceBuffer) GetProcAddress(m_hEVRLib, "MFCreateDXSurfaceBuffer") : nullptr;
+ pfMFCreateVideoSampleFromSurface = m_hEVRLib ? (PTR_MFCreateVideoSampleFromSurface) GetProcAddress(m_hEVRLib, "MFCreateVideoSampleFromSurface") : nullptr;
+ pfMFCreateVideoMediaType = m_hEVRLib ? (PTR_MFCreateVideoMediaType) GetProcAddress(m_hEVRLib, "MFCreateVideoMediaType") : nullptr;
if (!pfDXVA2CreateDirect3DDeviceManager9 || !pfMFCreateDXSurfaceBuffer || !pfMFCreateVideoSampleFromSurface || !pfMFCreateVideoMediaType) {
if (!pfDXVA2CreateDirect3DDeviceManager9) {
@@ -131,9 +131,9 @@ CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
// Load Vista specific DLLs
m_hAVRTLib = LoadLibrary(L"avrt.dll");
- pfAvSetMmThreadCharacteristicsW = m_hAVRTLib ? (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress(m_hAVRTLib, "AvSetMmThreadCharacteristicsW") : NULL;
- pfAvSetMmThreadPriority = m_hAVRTLib ? (PTR_AvSetMmThreadPriority) GetProcAddress(m_hAVRTLib, "AvSetMmThreadPriority") : NULL;
- pfAvRevertMmThreadCharacteristics = m_hAVRTLib ? (PTR_AvRevertMmThreadCharacteristics) GetProcAddress(m_hAVRTLib, "AvRevertMmThreadCharacteristics") : NULL;
+ pfAvSetMmThreadCharacteristicsW = m_hAVRTLib ? (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress(m_hAVRTLib, "AvSetMmThreadCharacteristicsW") : nullptr;
+ pfAvSetMmThreadPriority = m_hAVRTLib ? (PTR_AvSetMmThreadPriority) GetProcAddress(m_hAVRTLib, "AvSetMmThreadPriority") : nullptr;
+ pfAvRevertMmThreadCharacteristics = m_hAVRTLib ? (PTR_AvRevertMmThreadCharacteristics) GetProcAddress(m_hAVRTLib, "AvRevertMmThreadCharacteristics") : nullptr;
// Init DXVA manager
hr = pfDXVA2CreateDirect3DDeviceManager9(&m_nResetToken, &m_pD3DManager);
@@ -171,14 +171,14 @@ CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
m_bPendingRenegotiate = false;
m_bPendingMediaFinished = false;
m_bWaitingSample = false;
- m_pCurrentDisplaydSample = NULL;
+ m_pCurrentDisplaydSample = nullptr;
m_nStepCount = 0;
m_dwVideoAspectRatioMode = MFVideoARMode_PreservePicture;
m_dwVideoRenderPrefs = (MFVideoRenderPrefs)0;
m_BorderColor = RGB(0, 0, 0);
m_bSignaledStarvation = false;
m_StarvationClock = 0;
- m_pOuterEVR = NULL;
+ m_pOuterEVR = nullptr;
m_LastScheduledSampleTime = -1;
m_LastScheduledUncorrectedSampleTime = -1;
m_MaxSampleDuration = 0;
@@ -191,9 +191,9 @@ CEVRAllocatorPresenter::CEVRAllocatorPresenter(HWND hWnd, bool bFullscreen, HRES
CEVRAllocatorPresenter::~CEVRAllocatorPresenter()
{
StopWorkerThreads(); // If not already done...
- m_pMediaType = NULL;
- m_pClock = NULL;
- m_pD3DManager = NULL;
+ m_pMediaType = nullptr;
+ m_pClock = nullptr;
+ m_pD3DManager = nullptr;
if (m_hDXVA2Lib) {
FreeLibrary(m_hDXVA2Lib);
@@ -229,14 +229,14 @@ void CEVRAllocatorPresenter::StartWorkerThreads()
DWORD dwThreadId;
if (m_nRenderState == Shutdown) {
- m_hEvtQuit = CreateEvent(NULL, TRUE, FALSE, NULL);
- m_hEvtFlush = CreateEvent(NULL, TRUE, FALSE, NULL);
+ m_hEvtQuit = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ m_hEvtFlush = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- m_hThread = ::CreateThread(NULL, 0, PresentThread, (LPVOID)this, 0, &dwThreadId);
+ m_hThread = ::CreateThread(nullptr, 0, PresentThread, (LPVOID)this, 0, &dwThreadId);
SetThreadPriority(m_hThread, THREAD_PRIORITY_TIME_CRITICAL);
- m_hGetMixerThread = ::CreateThread(NULL, 0, GetMixerThreadStatic, (LPVOID)this, 0, &dwThreadId);
+ m_hGetMixerThread = ::CreateThread(nullptr, 0, GetMixerThreadStatic, (LPVOID)this, 0, &dwThreadId);
SetThreadPriority(m_hGetMixerThread, THREAD_PRIORITY_HIGHEST);
- m_hVSyncThread = ::CreateThread(NULL, 0, VSyncThreadStatic, (LPVOID)this, 0, &dwThreadId);
+ m_hVSyncThread = ::CreateThread(nullptr, 0, VSyncThreadStatic, (LPVOID)this, 0, &dwThreadId);
SetThreadPriority(m_hVSyncThread, THREAD_PRIORITY_HIGHEST);
m_nRenderState = Stopped;
@@ -293,10 +293,10 @@ STDMETHODIMP CEVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
{
CheckPointer(ppRenderer, E_POINTER);
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
HRESULT hr = S_OK;
- CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL);
+ CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), nullptr);
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK;
COuterEVR* pOuterEVR = DEBUG_NEW COuterEVR(NAME("COuterEVR"), pUnk, hr, &m_VMR9AlphaBitmap, this);
@@ -326,7 +326,7 @@ STDMETHODIMP CEVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
hr = QueryInterface(__uuidof(IMFVideoPresenter), (void**)&pVP);
}
if (SUCCEEDED(hr)) {
- hr = pMFVR->InitializeRenderer(NULL, pVP);
+ hr = pMFVR->InitializeRenderer(nullptr, pVP);
}
#if 1
@@ -340,7 +340,7 @@ STDMETHODIMP CEVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
#endif
if (FAILED(hr)) {
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
} else {
*ppRenderer = pBF.Detach();
}
@@ -553,7 +553,7 @@ STDMETHODIMP CEVRAllocatorPresenter::IsRateSupported(BOOL fThin, float flRate, f
}
// Return the nearest supported rate if the caller requested it.
- if (pflNearestSupportedRate != NULL) {
+ if (pflNearestSupportedRate != nullptr) {
*pflNearestSupportedRate = fNearestRate;
}
@@ -565,7 +565,7 @@ float CEVRAllocatorPresenter::GetMaxRate(BOOL bThin)
float fMaxRate = FLT_MAX; // Default.
UINT32 fpsNumerator = 0, fpsDenominator = 0;
- if (!bThin && (m_pMediaType != NULL)) {
+ if (!bThin && (m_pMediaType != nullptr)) {
// Non-thinned: Use the frame rate and monitor refresh rate.
// Frame rate:
@@ -705,7 +705,7 @@ HRESULT CEVRAllocatorPresenter::IsMediaTypeSupported(IMFMediaType* pMixerType)
HRESULT CEVRAllocatorPresenter::CreateProposedOutputType(IMFMediaType* pMixerType, IMFMediaType** pType)
{
HRESULT hr;
- AM_MEDIA_TYPE* pAMMedia = NULL;
+ AM_MEDIA_TYPE* pAMMedia = nullptr;
LARGE_INTEGER i64Size;
MFVIDEOFORMAT* VideoFormat;
@@ -811,7 +811,7 @@ HRESULT CEVRAllocatorPresenter::CreateProposedOutputType(IMFMediaType* pMixerTyp
HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
{
HRESULT hr;
- AM_MEDIA_TYPE* pAMMedia = NULL;
+ AM_MEDIA_TYPE* pAMMedia = nullptr;
CString strTemp, strTemp1;
CheckPointer(pType, E_POINTER);
@@ -833,7 +833,7 @@ HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
HRESULT CEVRAllocatorPresenter::GetMediaTypeFourCC(IMFMediaType* pType, DWORD* pFourCC)
{
- if (pFourCC == NULL) {
+ if (pFourCC == nullptr) {
return E_POINTER;
}
@@ -1001,9 +1001,9 @@ HRESULT CEVRAllocatorPresenter::RenegotiateMediaType()
// Loop through all of the mixer's proposed output types.
DWORD iTypeIndex = 0;
while ((hr != MF_E_NO_MORE_TYPES)) {
- pMixerType = NULL;
- pType = NULL;
- m_pMediaType = NULL;
+ pMixerType = nullptr;
+ pType = nullptr;
+ m_pMediaType = nullptr;
// Step 1. Get the next media type supported by mixer.
hr = m_pMixer->GetOutputAvailableType(0, iTypeIndex++, &pMixerType);
@@ -1074,15 +1074,15 @@ HRESULT CEVRAllocatorPresenter::RenegotiateMediaType()
// If something went wrong, clear the media type.
if (FAILED(hr)) {
- SetMediaType(NULL);
+ SetMediaType(nullptr);
} else {
break;
}
}
}
- pMixerType = NULL;
- pType = NULL;
+ pMixerType = nullptr;
+ pType = nullptr;
return hr;
}
@@ -1167,7 +1167,7 @@ STDMETHODIMP CEVRAllocatorPresenter::GetCurrentMediaType(__deref_out IMFVideoMe
CheckPointer(ppMediaType, E_POINTER);
CHECK_HR(CheckShutdown());
- if (m_pMediaType == NULL) {
+ if (m_pMediaType == nullptr) {
CHECK_HR(MF_E_NOT_INITIALIZED);
}
@@ -1201,9 +1201,9 @@ STDMETHODIMP CEVRAllocatorPresenter::ReleaseServicePointers()
{
TRACE_EVR("EVR: CEVRAllocatorPresenter::ReleaseServicePointers\n");
StopWorkerThreads();
- m_pMixer = NULL;
- m_pSink = NULL;
- m_pClock = NULL;
+ m_pMixer = nullptr;
+ m_pSink = nullptr;
+ m_pClock = nullptr;
return S_OK;
}
@@ -2281,7 +2281,7 @@ void CEVRAllocatorPresenter::RenderThread()
}
}
- m_pCurrentDisplaydSample = NULL;
+ m_pCurrentDisplaydSample = nullptr;
if (bStepForward) {
MoveToFreeList(pMFSample, true);
CheckWaitingSampleFromMixer();
@@ -2570,7 +2570,7 @@ void CEVRAllocatorPresenter::MoveToScheduledList(IMFSample* pSample, bool _bSort
LONGLONG NewSampleTime;
pSample->GetSampleTime(&NewSampleTime);
- while (Iterator != NULL)
+ while (Iterator != nullptr)
{
POSITION CurrentPos = Iterator;
IMFSample *pIter = m_ScheduledSamples.GetNext(Iterator);
diff --git a/src/filters/renderer/VideoRenderers/IPinHook.cpp b/src/filters/renderer/VideoRenderers/IPinHook.cpp
index ba9b2fa52..d64a06c42 100644
--- a/src/filters/renderer/VideoRenderers/IPinHook.cpp
+++ b/src/filters/renderer/VideoRenderers/IPinHook.cpp
@@ -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.
*
@@ -46,8 +46,8 @@ REFERENCE_TIME g_tSampleStart = 0;
GUID g_guidDXVADecoder = GUID_NULL;
int g_nDXVAVersion = 0;
-IPinCVtbl* g_pPinCVtbl = NULL;
-IMemInputPinCVtbl* g_pMemInputPinCVtbl = NULL;
+IPinCVtbl* g_pPinCVtbl = nullptr;
+IMemInputPinCVtbl* g_pMemInputPinCVtbl = nullptr;
typedef struct {
const int Format;
@@ -140,7 +140,7 @@ LPCTSTR FindD3DFormat(const D3DFORMAT Format)
}
// === DirectShow hooks
-static HRESULT(STDMETHODCALLTYPE* NewSegmentOrg)(IPinC* This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate) = NULL;
+static HRESULT(STDMETHODCALLTYPE* NewSegmentOrg)(IPinC* This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate) = nullptr;
static HRESULT STDMETHODCALLTYPE NewSegmentMine(IPinC* This, /* [in] */ REFERENCE_TIME tStart, /* [in] */ REFERENCE_TIME tStop, /* [in] */ double dRate)
{
@@ -148,7 +148,7 @@ static HRESULT STDMETHODCALLTYPE NewSegmentMine(IPinC* This, /* [in] */ REFERENC
return NewSegmentOrg(This, tStart, tStop, dRate);
}
-static HRESULT(STDMETHODCALLTYPE* ReceiveOrg)(IMemInputPinC* This, IMediaSample* pSample) = NULL;
+static HRESULT(STDMETHODCALLTYPE* ReceiveOrg)(IMemInputPinC* This, IMediaSample* pSample) = nullptr;
static HRESULT STDMETHODCALLTYPE ReceiveMineI(IMemInputPinC* This, IMediaSample* pSample)
{
@@ -189,10 +189,10 @@ void UnhookNewSegmentAndReceive()
}
res = VirtualProtect(g_pMemInputPinCVtbl, sizeof(IMemInputPinCVtbl), flOldProtect, &flOldProtect);
- g_pPinCVtbl = NULL;
- g_pMemInputPinCVtbl = NULL;
- NewSegmentOrg = NULL;
- ReceiveOrg = NULL;
+ g_pPinCVtbl = nullptr;
+ g_pMemInputPinCVtbl = nullptr;
+ NewSegmentOrg = nullptr;
+ ReceiveOrg = nullptr;
}
}
@@ -212,7 +212,7 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
// Casimir666 : change sizeof(IPinC) to sizeof(IPinCVtbl) to fix crash with EVR hack on Vista!
res = VirtualProtect(pPinC->lpVtbl, sizeof(IPinCVtbl), PAGE_WRITECOPY, &flOldProtect);
- if (NewSegmentOrg == NULL) {
+ if (NewSegmentOrg == nullptr) {
NewSegmentOrg = pPinC->lpVtbl->NewSegment;
}
pPinC->lpVtbl->NewSegment = NewSegmentMine; // Function sets global variable(s)
@@ -220,7 +220,7 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
// Casimir666 : change sizeof(IMemInputPinC) to sizeof(IMemInputPinCVtbl) to fix crash with EVR hack on Vista!
res = VirtualProtect(pMemInputPinC->lpVtbl, sizeof(IMemInputPinCVtbl), PAGE_WRITECOPY, &flOldProtect);
- if (ReceiveOrg == NULL) {
+ if (ReceiveOrg == nullptr) {
ReceiveOrg = pMemInputPinC->lpVtbl->Receive;
}
pMemInputPinC->lpVtbl->Receive = ReceiveMine; // Function sets global variable(s)
@@ -239,22 +239,22 @@ bool HookNewSegmentAndReceive(IPinC* pPinC, IMemInputPinC* pMemInputPinC)
#define MAX_BUFFER_TYPE 15
BYTE* g_ppBuffer[MAX_BUFFER_TYPE]; // Only used for debug logging
-static HRESULT(STDMETHODCALLTYPE* GetVideoAcceleratorGUIDsOrg)(IAMVideoAcceleratorC* This,/* [out][in] */ LPDWORD pdwNumGuidsSupported,/* [out][in] */ LPGUID pGuidsSupported) = NULL;
-static HRESULT(STDMETHODCALLTYPE* GetUncompFormatsSupportedOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [out][in] */ LPDWORD pdwNumFormatsSupported,/* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) = NULL;
-static HRESULT(STDMETHODCALLTYPE* GetInternalMemInfoOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [in] */ const AMVAUncompDataInfo* pamvaUncompDataInfo,/* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) = NULL;
+static HRESULT(STDMETHODCALLTYPE* GetVideoAcceleratorGUIDsOrg)(IAMVideoAcceleratorC* This,/* [out][in] */ LPDWORD pdwNumGuidsSupported,/* [out][in] */ LPGUID pGuidsSupported) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* GetUncompFormatsSupportedOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [out][in] */ LPDWORD pdwNumFormatsSupported,/* [out][in] */ LPDDPIXELFORMAT pFormatsSupported) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* GetInternalMemInfoOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [in] */ const AMVAUncompDataInfo* pamvaUncompDataInfo,/* [out][in] */ LPAMVAInternalMemInfo pamvaInternalMemInfo) = nullptr;
#endif
-static HRESULT(STDMETHODCALLTYPE* GetCompBufferInfoOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [in] */ const AMVAUncompDataInfo* pamvaUncompDataInfo,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL;
+static HRESULT(STDMETHODCALLTYPE* GetCompBufferInfoOrg)(IAMVideoAcceleratorC* This,/* [in] */ const GUID* pGuid,/* [in] */ const AMVAUncompDataInfo* pamvaUncompDataInfo,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = nullptr;
#ifdef _DEBUG
-static HRESULT(STDMETHODCALLTYPE* GetInternalCompBufferInfoOrg)(IAMVideoAcceleratorC* This,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = NULL;
-static HRESULT(STDMETHODCALLTYPE* BeginFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ const AMVABeginFrameInfo* amvaBeginFrameInfo) = NULL;
-static HRESULT(STDMETHODCALLTYPE* EndFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ const AMVAEndFrameInfo* pEndFrameInfo) = NULL;
-static HRESULT(STDMETHODCALLTYPE* GetBufferOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ BOOL bReadOnly,/* [out] */ LPVOID* ppBuffer,/* [out] */ LONG* lpStride) = NULL;
-static HRESULT(STDMETHODCALLTYPE* ReleaseBufferOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex) = NULL;
-static HRESULT(STDMETHODCALLTYPE* ExecuteOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwFunction,/* [in] */ LPVOID lpPrivateInputData,/* [in] */ DWORD cbPrivateInputData,/* [in] */ LPVOID lpPrivateOutputDat,/* [in] */ DWORD cbPrivateOutputData,/* [in] */ DWORD dwNumBuffers,/* [in] */ const AMVABUFFERINFO* pamvaBufferInfo) = NULL;
-static HRESULT(STDMETHODCALLTYPE* QueryRenderStatusOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ DWORD dwFlags) = NULL;
-static HRESULT(STDMETHODCALLTYPE* DisplayFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwFlipToIndex,/* [in] */ IMediaSample* pMediaSample) = NULL;
+static HRESULT(STDMETHODCALLTYPE* GetInternalCompBufferInfoOrg)(IAMVideoAcceleratorC* This,/* [out][in] */ LPDWORD pdwNumTypesCompBuffers,/* [out] */ LPAMVACompBufferInfo pamvaCompBufferInfo) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* BeginFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ const AMVABeginFrameInfo* amvaBeginFrameInfo) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* EndFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ const AMVAEndFrameInfo* pEndFrameInfo) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* GetBufferOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ BOOL bReadOnly,/* [out] */ LPVOID* ppBuffer,/* [out] */ LONG* lpStride) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* ReleaseBufferOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* ExecuteOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwFunction,/* [in] */ LPVOID lpPrivateInputData,/* [in] */ DWORD cbPrivateInputData,/* [in] */ LPVOID lpPrivateOutputDat,/* [in] */ DWORD cbPrivateOutputData,/* [in] */ DWORD dwNumBuffers,/* [in] */ const AMVABUFFERINFO* pamvaBufferInfo) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* QueryRenderStatusOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwTypeIndex,/* [in] */ DWORD dwBufferIndex,/* [in] */ DWORD dwFlags) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* DisplayFrameOrg)(IAMVideoAcceleratorC* This,/* [in] */ DWORD dwFlipToIndex,/* [in] */ IMediaSample* pMediaSample) = nullptr;
#endif
#if defined(_DEBUG) && DXVA_LOGFILE_A
@@ -422,7 +422,7 @@ static void LogDXVA_PicParams_H264(DXVA_PicParams_H264* pPic)
//}
// === Dump PicParams!
- //static FILE* hPict = NULL;
+ //static FILE* hPict = nullptr;
//if (!hPict) hPict = fopen ("PicParam.bin", "wb");
//if (hPict)
//{
@@ -987,42 +987,42 @@ void HookAMVideoAccelerator(IAMVideoAcceleratorC* pAMVideoAcceleratorC)
res = VirtualProtect(pAMVideoAcceleratorC->lpVtbl, sizeof(IAMVideoAcceleratorC), PAGE_WRITECOPY, &flOldProtect);
#ifdef _DEBUG
- if (GetVideoAcceleratorGUIDsOrg == NULL) {
+ if (GetVideoAcceleratorGUIDsOrg == nullptr) {
GetVideoAcceleratorGUIDsOrg = pAMVideoAcceleratorC->lpVtbl->GetVideoAcceleratorGUIDs;
}
- if (GetUncompFormatsSupportedOrg == NULL) {
+ if (GetUncompFormatsSupportedOrg == nullptr) {
GetUncompFormatsSupportedOrg = pAMVideoAcceleratorC->lpVtbl->GetUncompFormatsSupported;
}
- if (GetInternalMemInfoOrg == NULL) {
+ if (GetInternalMemInfoOrg == nullptr) {
GetInternalMemInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalMemInfo;
}
#endif
- if (GetCompBufferInfoOrg == NULL) {
+ if (GetCompBufferInfoOrg == nullptr) {
GetCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetCompBufferInfo;
}
#ifdef _DEBUG
- if (GetInternalCompBufferInfoOrg == NULL) {
+ if (GetInternalCompBufferInfoOrg == nullptr) {
GetInternalCompBufferInfoOrg = pAMVideoAcceleratorC->lpVtbl->GetInternalCompBufferInfo;
}
- if (BeginFrameOrg == NULL) {
+ if (BeginFrameOrg == nullptr) {
BeginFrameOrg = pAMVideoAcceleratorC->lpVtbl->BeginFrame;
}
- if (EndFrameOrg == NULL) {
+ if (EndFrameOrg == nullptr) {
EndFrameOrg = pAMVideoAcceleratorC->lpVtbl->EndFrame;
}
- if (GetBufferOrg == NULL) {
+ if (GetBufferOrg == nullptr) {
GetBufferOrg = pAMVideoAcceleratorC->lpVtbl->GetBuffer;
}
- if (ReleaseBufferOrg == NULL) {
+ if (ReleaseBufferOrg == nullptr) {
ReleaseBufferOrg = pAMVideoAcceleratorC->lpVtbl->ReleaseBuffer;
}
- if (ExecuteOrg == NULL) {
+ if (ExecuteOrg == nullptr) {
ExecuteOrg = pAMVideoAcceleratorC->lpVtbl->Execute;
}
- if (QueryRenderStatusOrg == NULL) {
+ if (QueryRenderStatusOrg == nullptr) {
QueryRenderStatusOrg = pAMVideoAcceleratorC->lpVtbl->QueryRenderStatus;
}
- if (DisplayFrameOrg == NULL) {
+ if (DisplayFrameOrg == nullptr) {
DisplayFrameOrg = pAMVideoAcceleratorC->lpVtbl->DisplayFrame;
}
@@ -1297,16 +1297,16 @@ interface IDirectXVideoDecoderServiceC {
};
-IDirectXVideoDecoderServiceCVtbl* g_pIDirectXVideoDecoderServiceCVtbl = NULL;
+IDirectXVideoDecoderServiceCVtbl* g_pIDirectXVideoDecoderServiceCVtbl = nullptr;
static HRESULT(STDMETHODCALLTYPE* CreateVideoDecoderOrg)(IDirectXVideoDecoderServiceC* pThis,
__in REFGUID Guid,
__in const DXVA2_VideoDesc* pVideoDesc,
__in const DXVA2_ConfigPictureDecode* pConfig,
__in_ecount(NumRenderTargets)
- IDirect3DSurface9** ppDecoderRenderTargets, __in UINT NumRenderTargets, __deref_out IDirectXVideoDecoder** ppDecode) = NULL;
+ IDirect3DSurface9** ppDecoderRenderTargets, __in UINT NumRenderTargets, __deref_out IDirectXVideoDecoder** ppDecode) = nullptr;
#ifdef _DEBUG
-static HRESULT(STDMETHODCALLTYPE* GetDecoderDeviceGuidsOrg)(IDirectXVideoDecoderServiceC* pThis, __out UINT* pCount, __deref_out_ecount_opt(*pCount) GUID** pGuids) = NULL;
-static HRESULT(STDMETHODCALLTYPE* GetDecoderConfigurationsOrg)(IDirectXVideoDecoderServiceC* pThis, __in REFGUID Guid, __in const DXVA2_VideoDesc* pVideoDesc, __reserved void* pReserved, __out UINT* pCount, __deref_out_ecount_opt(*pCount) DXVA2_ConfigPictureDecode** ppConfigs) = NULL;
+static HRESULT(STDMETHODCALLTYPE* GetDecoderDeviceGuidsOrg)(IDirectXVideoDecoderServiceC* pThis, __out UINT* pCount, __deref_out_ecount_opt(*pCount) GUID** pGuids) = nullptr;
+static HRESULT(STDMETHODCALLTYPE* GetDecoderConfigurationsOrg)(IDirectXVideoDecoderServiceC* pThis, __in REFGUID Guid, __in const DXVA2_VideoDesc* pVideoDesc, __reserved void* pReserved, __out UINT* pCount, __deref_out_ecount_opt(*pCount) DXVA2_ConfigPictureDecode** ppConfigs) = nullptr;
#endif
#ifdef _DEBUG
@@ -1351,7 +1351,7 @@ static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
{
HRESULT hr;
UINT cDecoderGuids = 0;
- GUID* pDecoderGuids = NULL;
+ GUID* pDecoderGuids = nullptr;
hr = pDecoderService->GetDecoderDeviceGuids(&cDecoderGuids, &pDecoderGuids);
if (SUCCEEDED(hr)) {
@@ -1362,8 +1362,8 @@ static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
// Find a configuration that we support.
UINT cFormats = 0;
UINT cConfigurations = 0;
- D3DFORMAT* pFormats = NULL;
- DXVA2_ConfigPictureDecode* pConfig = NULL;
+ D3DFORMAT* pFormats = nullptr;
+ DXVA2_ConfigPictureDecode* pConfig = nullptr;
DXVA2_VideoDesc m_VideoDesc;
hr = pDecoderService->GetDecoderRenderTargets(pDecoderGuids[iGuid], &cFormats, &pFormats);
@@ -1379,7 +1379,7 @@ static void LogVideoCardCaps(IDirectXVideoDecoderService* pDecoderService)
m_VideoDesc.Format = pFormats[iFormat];
// Get the available configurations.
- hr = pDecoderService->GetDecoderConfigurations(pDecoderGuids[iGuid], &m_VideoDesc, NULL, &cConfigurations, &pConfig);
+ hr = pDecoderService->GetDecoderConfigurations(pDecoderGuids[iGuid], &m_VideoDesc, nullptr, &cConfigurations, &pConfig);
if (SUCCEEDED(hr)) {
@@ -1434,7 +1434,7 @@ static HRESULT STDMETHODCALLTYPE CreateVideoDecoderMine(
(Guid == DXVA_Intel_VC1_ClearVideo) ||
(Guid == DXVA_Intel_VC1_ClearVideo_2) ||
(Guid == DXVA2_ModeMPEG2_VLD)) {
- *ppDecode = DEBUG_NEW CFakeDirectXVideoDecoder(NULL, *ppDecode);
+ *ppDecode = DEBUG_NEW CFakeDirectXVideoDecoder(nullptr, *ppDecode);
(*ppDecode)->AddRef();
}
@@ -1503,10 +1503,10 @@ void HookDirectXVideoDecoderService(void* pIDirectXVideoDecoderService)
res = VirtualProtect(g_pIDirectXVideoDecoderServiceCVtbl, sizeof(g_pIDirectXVideoDecoderServiceCVtbl), flOldProtect, &flOldProtect);
- g_pIDirectXVideoDecoderServiceCVtbl = NULL;
- CreateVideoDecoderOrg = NULL;
+ g_pIDirectXVideoDecoderServiceCVtbl = nullptr;
+ CreateVideoDecoderOrg = nullptr;
#ifdef _DEBUG
- GetDecoderConfigurationsOrg = NULL;
+ GetDecoderConfigurationsOrg = nullptr;
#endif
g_guidDXVADecoder = GUID_NULL;
g_nDXVAVersion = 0;
diff --git a/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp b/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
index 2d734c53d..b36cb2c46 100644
--- a/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
+++ b/src/filters/renderer/VideoRenderers/PixelShaderCompiler.cpp
@@ -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.
*
@@ -27,8 +27,8 @@
CPixelShaderCompiler::CPixelShaderCompiler(IDirect3DDevice9* pD3DDev, bool fStaySilent)
: m_pD3DDev(pD3DDev)
- , m_pD3DXCompileShader(NULL)
- , m_pD3DXDisassembleShader(NULL)
+ , m_pD3DXCompileShader(nullptr)
+ , m_pD3DXDisassembleShader(nullptr)
{
HINSTANCE hDll;
hDll = GetRenderersData()->GetD3X9Dll();
@@ -67,7 +67,7 @@ HRESULT CPixelShaderCompiler::CompileShader(
HRESULT hr;
CComPtr<ID3DXBuffer> pShader, pDisAsm, pErrorMsgs;
- hr = m_pD3DXCompileShader(pSrcData, (UINT)strlen(pSrcData), NULL, NULL, pFunctionName, pProfile, Flags, &pShader, &pErrorMsgs, NULL);
+ hr = m_pD3DXCompileShader(pSrcData, (UINT)strlen(pSrcData), nullptr, nullptr, pFunctionName, pProfile, Flags, &pShader, &pErrorMsgs, nullptr);
if (FAILED(hr)) {
if (errmsg) {
@@ -95,7 +95,7 @@ HRESULT CPixelShaderCompiler::CompileShader(
}
if (disasm) {
- hr = m_pD3DXDisassembleShader((DWORD*)pShader->GetBufferPointer(), FALSE, NULL, &pDisAsm);
+ hr = m_pD3DXDisassembleShader((DWORD*)pShader->GetBufferPointer(), FALSE, nullptr, &pDisAsm);
if (SUCCEEDED(hr) && pDisAsm) {
*disasm = CStringA((const char*)pDisAsm->GetBufferPointer());
}
diff --git a/src/filters/renderer/VideoRenderers/QT7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/QT7AllocatorPresenter.cpp
index ab2b03c75..137385904 100644
--- a/src/filters/renderer/VideoRenderers/QT7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/QT7AllocatorPresenter.cpp
@@ -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.
*
@@ -46,7 +46,7 @@ HRESULT CQT7AllocatorPresenter::AllocSurfaces()
{
CAutoLock cAutoLock(this);
- m_pVideoSurfaceOff = NULL;
+ m_pVideoSurfaceOff = nullptr;
DDSURFACEDESC2 ddsd;
INITDDSTRUCT(ddsd);
@@ -62,7 +62,7 @@ HRESULT CQT7AllocatorPresenter::AllocSurfaces()
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;
- HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, NULL);
+ HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, nullptr);
if (FAILED(hr)) {
return E_FAIL;
}
@@ -70,7 +70,7 @@ HRESULT CQT7AllocatorPresenter::AllocSurfaces()
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurfaceOff->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
return __super::AllocSurfaces();
}
@@ -79,7 +79,7 @@ void CQT7AllocatorPresenter::DeleteSurfaces()
{
CAutoLock cAutoLock(this);
- m_pVideoSurfaceOff = NULL;
+ m_pVideoSurfaceOff = nullptr;
__super::DeleteSurfaces();
}
@@ -122,12 +122,12 @@ STDMETHODIMP CQT7AllocatorPresenter::DoBlt(const BITMAP& bm)
if ((bpp == 16 || bpp == 24 || bpp == 32) && w == ddsd.dwWidth && h == ddsd.dwHeight) {
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceOff->Lock(NULL, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceOff->Lock(nullptr, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BitBltFromRGBToRGB(
w, h,
(BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount,
(BYTE*)bm.bmBits, bm.bmWidthBytes, bm.bmBitsPixel);
- m_pVideoSurfaceOff->Unlock(NULL);
+ m_pVideoSurfaceOff->Unlock(nullptr);
fOk = true;
}
}
@@ -136,7 +136,7 @@ STDMETHODIMP CQT7AllocatorPresenter::DoBlt(const BITMAP& bm)
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurfaceOff->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
HDC hDC;
if (SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) {
@@ -151,7 +151,7 @@ STDMETHODIMP CQT7AllocatorPresenter::DoBlt(const BITMAP& bm)
}
}
- m_pVideoSurface->Blt(NULL, m_pVideoSurfaceOff, NULL, DDBLT_WAIT, NULL);
+ m_pVideoSurface->Blt(nullptr, m_pVideoSurfaceOff, nullptr, DDBLT_WAIT, nullptr);
Paint(true);
diff --git a/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
index 4e3add16d..e4769a3b0 100644
--- a/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/QT9AllocatorPresenter.cpp
@@ -45,11 +45,11 @@ HRESULT CQT9AllocatorPresenter::AllocSurfaces()
{
HRESULT hr;
- m_pVideoSurfaceOff = NULL;
+ m_pVideoSurfaceOff = nullptr;
if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(
m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8,
- D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, NULL))) {
+ D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, nullptr))) {
return hr;
}
@@ -58,7 +58,7 @@ HRESULT CQT9AllocatorPresenter::AllocSurfaces()
void CQT9AllocatorPresenter::DeleteSurfaces()
{
- m_pVideoSurfaceOff = NULL;
+ m_pVideoSurfaceOff = nullptr;
__super::DeleteSurfaces();
}
@@ -100,7 +100,7 @@ STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm)
if ((bpp == 16 || bpp == 24 || bpp == 32) && w == d3dsd.Width && h == d3dsd.Height) {
D3DLOCKED_RECT r;
- if (SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, NULL, 0))) {
+ if (SUCCEEDED(m_pVideoSurfaceOff->LockRect(&r, nullptr, 0))) {
BitBltFromRGBToRGB(
w, h,
(BYTE*)r.pBits, r.Pitch, dbpp,
@@ -111,7 +111,7 @@ STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm)
}
if (!fOk) {
- m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0);
+ m_pD3DDev->ColorFill(m_pVideoSurfaceOff, nullptr, 0);
HDC hDC;
if (SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) {
@@ -126,7 +126,7 @@ STDMETHODIMP CQT9AllocatorPresenter::DoBlt(const BITMAP& bm)
}
}
- m_pD3DDev->StretchRect(m_pVideoSurfaceOff, NULL, m_pVideoSurface[m_nCurSurface], NULL, D3DTEXF_NONE);
+ m_pD3DDev->StretchRect(m_pVideoSurfaceOff, nullptr, m_pVideoSurface[m_nCurSurface], nullptr, D3DTEXF_NONE);
Paint(true);
diff --git a/src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp
index adbe5720b..9438214a5 100644
--- a/src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp
@@ -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.
*
@@ -46,8 +46,8 @@ HRESULT CRM7AllocatorPresenter::AllocSurfaces()
{
CAutoLock cAutoLock(this);
- m_pVideoSurfaceOff = NULL;
- m_pVideoSurfaceYUY2 = NULL;
+ m_pVideoSurfaceOff = nullptr;
+ m_pVideoSurfaceYUY2 = nullptr;
DDSURFACEDESC2 ddsd;
DDBLTFX fx;
@@ -65,14 +65,14 @@ HRESULT CRM7AllocatorPresenter::AllocSurfaces()
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;
- HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, NULL);
+ HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, nullptr);
if (FAILED(hr)) {
return E_FAIL;
}
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurfaceOff->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
INITDDSTRUCT(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
@@ -84,16 +84,16 @@ HRESULT CRM7AllocatorPresenter::AllocSurfaces()
ddsd.ddpfPixelFormat.dwYUVBitCount = 16;
ddsd.ddpfPixelFormat.dwFourCC = '2YUY';
- hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceYUY2, NULL);
+ hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceYUY2, nullptr);
- if (FAILED(m_pVideoSurfaceOff->Blt(NULL, m_pVideoSurfaceYUY2, NULL, DDBLT_WAIT, NULL))) {
- m_pVideoSurfaceYUY2 = NULL;
+ if (FAILED(m_pVideoSurfaceOff->Blt(nullptr, m_pVideoSurfaceYUY2, nullptr, DDBLT_WAIT, nullptr))) {
+ m_pVideoSurfaceYUY2 = nullptr;
}
if (m_pVideoSurfaceYUY2) {
INITDDSTRUCT(fx);
fx.dwFillColor = 0x80108010;
- m_pVideoSurfaceYUY2->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurfaceYUY2->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
}
return __super::AllocSurfaces();
@@ -103,8 +103,8 @@ void CRM7AllocatorPresenter::DeleteSurfaces()
{
CAutoLock cAutoLock(this);
- m_pVideoSurfaceOff = NULL;
- m_pVideoSurfaceYUY2 = NULL;
+ m_pVideoSurfaceOff = nullptr;
+ m_pVideoSurfaceYUY2 = nullptr;
__super::DeleteSurfaces();
}
@@ -137,14 +137,14 @@ STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
if (m_pVideoSurfaceYUY2) {
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BitBltFromI420ToYUY2(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, y, u, v, pitch);
m_pVideoSurfaceYUY2->Unlock(src2);
fYUY2 = true;
}
} else {
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BitBltFromI420ToRGB(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, y, u, v, pitch);
m_pVideoSurfaceOff->Unlock(src2);
fRGB = true;
@@ -161,14 +161,14 @@ STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
if (m_pVideoSurfaceYUY2) {
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceYUY2->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BitBltFromYUY2ToYUY2(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, yvyu, pitch);
m_pVideoSurfaceYUY2->Unlock(src2);
fYUY2 = true;
}
} else {
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BitBltFromYUY2ToRGB(src.Width(), src.Height(), (BYTE*)ddsd.lpSurface, ddsd.lPitch, ddsd.ddpfPixelFormat.dwRGBBitCount, yvyu, pitch);
m_pVideoSurfaceOff->Unlock(src2);
fRGB = true;
@@ -185,7 +185,7 @@ STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
BYTE* rgb = pImageData + src.top * pitch + src.left * (pBitmapInfo->biBitCount >> 3);
INITDDSTRUCT(ddsd);
- if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, NULL))) {
+ if (SUCCEEDED(m_pVideoSurfaceOff->Lock(src2, &ddsd, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR | DDLOCK_WRITEONLY, nullptr))) {
BYTE* lpSurface = (BYTE*)ddsd.lpSurface;
if (pBitmapInfo->biHeight > 0) {
lpSurface += ddsd.lPitch * (src.Height() - 1);
@@ -201,7 +201,7 @@ STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- m_pVideoSurfaceOff->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurfaceOff->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
HDC hDC;
if (SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) {
@@ -222,10 +222,10 @@ STDMETHODIMP CRM7AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
HRESULT hr;
if (fRGB) {
- hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceOff, src2, DDBLT_WAIT, NULL);
+ hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceOff, src2, DDBLT_WAIT, nullptr);
}
if (fYUY2) {
- hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceYUY2, src2, DDBLT_WAIT, NULL);
+ hr = m_pVideoSurface->Blt(dst, m_pVideoSurfaceYUY2, src2, DDBLT_WAIT, nullptr);
}
Paint(true);
diff --git a/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
index 07bf32fac..1e03c97ab 100644
--- a/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/RM9AllocatorPresenter.cpp
@@ -46,27 +46,27 @@ HRESULT CRM9AllocatorPresenter::AllocSurfaces()
CAutoLock cAutoLock(this);
CAutoLock cRenderLock(&m_RenderLock);
- m_pVideoSurfaceOff = NULL;
- m_pVideoSurfaceYUY2 = NULL;
+ m_pVideoSurfaceOff = nullptr;
+ m_pVideoSurfaceYUY2 = nullptr;
HRESULT hr;
if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(
m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8,
- D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, NULL))) {
+ D3DPOOL_DEFAULT, &m_pVideoSurfaceOff, nullptr))) {
return hr;
}
- m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0);
+ m_pD3DDev->ColorFill(m_pVideoSurfaceOff, nullptr, 0);
if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(
m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_YUY2,
- D3DPOOL_DEFAULT, &m_pVideoSurfaceYUY2, NULL))) {
- m_pVideoSurfaceYUY2 = NULL;
+ D3DPOOL_DEFAULT, &m_pVideoSurfaceYUY2, nullptr))) {
+ m_pVideoSurfaceYUY2 = nullptr;
}
if (m_pVideoSurfaceYUY2) {
- m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0x80108010);
+ m_pD3DDev->ColorFill(m_pVideoSurfaceOff, nullptr, 0x80108010);
}
return __super::AllocSurfaces();
@@ -76,8 +76,8 @@ void CRM9AllocatorPresenter::DeleteSurfaces()
{
CAutoLock cAutoLock(this);
CAutoLock cRenderLock(&m_RenderLock);
- m_pVideoSurfaceOff = NULL;
- m_pVideoSurfaceYUY2 = NULL;
+ m_pVideoSurfaceOff = nullptr;
+ m_pVideoSurfaceYUY2 = nullptr;
__super::DeleteSurfaces();
}
@@ -178,7 +178,7 @@ STDMETHODIMP CRM9AllocatorPresenter::Blt(UCHAR* pImageData, RMABitmapInfoHeader*
}
if (!fRGB && !fYUY2) {
- m_pD3DDev->ColorFill(m_pVideoSurfaceOff, NULL, 0);
+ m_pD3DDev->ColorFill(m_pVideoSurfaceOff, nullptr, 0);
HDC hDC;
if (SUCCEEDED(m_pVideoSurfaceOff->GetDC(&hDC))) {
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
index 53f69b2a5..355703a75 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
@@ -101,7 +101,7 @@ CRenderersData::CRenderersData()
m_fTearingTest = false;
m_fDisplayStats = false;
m_bResetStats = false;
- m_hD3DX9Dll = NULL;
+ m_hD3DX9Dll = nullptr;
m_nDXSdkRelease = 0;
// Don't disable hardware features before initializing a renderer
@@ -130,7 +130,7 @@ HINSTANCE CRenderersData::GetD3X9Dll()
#pragma message("ERROR: DirectX SDK " MPC_DX_SDK_MONTH " " MAKE_STR(MPC_DX_SDK_YEAR) " (v" MAKE_STR(MPC_DX_SDK_NUMBER) ") or newer is required to build MPC-HC")
#endif
- if (m_hD3DX9Dll == NULL) {
+ if (m_hD3DX9Dll == nullptr) {
m_nDXSdkRelease = 0;
// load latest compatible version of the DLL that is available
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index ea333149d..5b99041d2 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -68,11 +68,11 @@ CBaseAP::CBaseAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error):
m_hEvtQuit(INVALID_HANDLE_VALUE),
m_bIsFullscreen(bFullscreen),
m_uSyncGlitches(0),
- m_pGenlock(NULL),
+ m_pGenlock(nullptr),
m_lAudioLag(0),
m_lAudioLagMin(10000),
m_lAudioLagMax(-10000),
- m_pAudioStats(NULL),
+ m_pAudioStats(nullptr),
m_nNextJitter(0),
m_nNextSyncOffset(0),
m_llLastSyncTime(0),
@@ -97,10 +97,10 @@ CBaseAP::CBaseAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error):
}
HINSTANCE hDll;
- m_pD3DXLoadSurfaceFromMemory = NULL;
- m_pD3DXCreateLine = NULL;
- m_pD3DXCreateFont = NULL;
- m_pD3DXCreateSprite = NULL;
+ m_pD3DXLoadSurfaceFromMemory = nullptr;
+ m_pD3DXCreateLine = nullptr;
+ m_pD3DXCreateFont = nullptr;
+ m_pD3DXCreateSprite = nullptr;
hDll = GetRenderersData()->GetD3X9Dll();
if (hDll) {
(FARPROC&)m_pD3DXLoadSurfaceFromMemory = GetProcAddress(hDll, "D3DXLoadSurfaceFromMemory");
@@ -113,15 +113,15 @@ CBaseAP::CBaseAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error):
_Error += _T(" release or newer in order for MPC-HC to function properly.\n");
}
- m_pDwmIsCompositionEnabled = NULL;
- m_pDwmEnableComposition = NULL;
+ m_pDwmIsCompositionEnabled = nullptr;
+ m_pDwmEnableComposition = nullptr;
m_hDWMAPI = LoadLibrary(L"dwmapi.dll");
if (m_hDWMAPI) {
(FARPROC&)m_pDwmIsCompositionEnabled = GetProcAddress(m_hDWMAPI, "DwmIsCompositionEnabled");
(FARPROC&)m_pDwmEnableComposition = GetProcAddress(m_hDWMAPI, "DwmEnableComposition");
}
- m_pDirect3DCreate9Ex = NULL;
+ m_pDirect3DCreate9Ex = nullptr;
m_hD3D9 = LoadLibrary(L"d3d9.dll");
#ifndef DISABLE_USING_D3D9EX
if (m_hD3D9) {
@@ -175,22 +175,22 @@ CBaseAP::~CBaseAP()
}
}
- m_pFont = NULL;
- m_pLine = NULL;
- m_pD3DDev = NULL;
- m_pD3DDevEx = NULL;
+ m_pFont = nullptr;
+ m_pLine = nullptr;
+ m_pD3DDev = nullptr;
+ m_pD3DDevEx = nullptr;
m_pPSC.Free();
- m_pD3D = NULL;
- m_pD3DEx = NULL;
+ m_pD3D = nullptr;
+ m_pD3DEx = nullptr;
if (m_hDWMAPI) {
FreeLibrary(m_hDWMAPI);
- m_hDWMAPI = NULL;
+ m_hDWMAPI = nullptr;
}
if (m_hD3D9) {
FreeLibrary(m_hD3D9);
- m_hD3D9 = NULL;
+ m_hD3D9 = nullptr;
}
- m_pAudioStats = NULL;
+ m_pAudioStats = nullptr;
SAFE_DELETE(m_pGenlock);
}
@@ -279,7 +279,7 @@ HRESULT CBaseAP::TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[
hr = pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, v, sizeof(v[0]));
for (int i = 0; i < texcoords; i++) {
- pD3DDev->SetTexture(i, NULL);
+ pD3DDev->SetTexture(i, nullptr);
}
return S_OK;
@@ -381,13 +381,13 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
m_LastRendererSettings = s.m_AdvRendSets;
HRESULT hr = E_FAIL;
- m_pFont = NULL;
- m_pSprite = NULL;
- m_pLine = NULL;
+ m_pFont = nullptr;
+ m_pSprite = nullptr;
+ m_pLine = nullptr;
m_pPSC.Free();
- m_pD3DDev = NULL;
- m_pD3DDevEx = NULL;
+ m_pD3DDev = nullptr;
+ m_pD3DDevEx = nullptr;
m_pResizerPixelShader[0] = 0;
m_pResizerPixelShader[1] = 0;
@@ -397,12 +397,12 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
POSITION pos = m_pPixelShadersScreenSpace.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pPixelShadersScreenSpace.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
pos = m_pPixelShaders.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pPixelShaders.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
if (!m_pD3D) {
@@ -464,7 +464,7 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
D3DDISPLAYMODEEX DisplayMode;
ZeroMemory(&DisplayMode, sizeof(DisplayMode));
DisplayMode.Size = sizeof(DisplayMode);
- m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, NULL);
+ m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, nullptr);
DisplayMode.Format = pp.BackBufferFormat;
pp.FullScreen_RefreshRateInHz = DisplayMode.RefreshRate;
@@ -524,7 +524,7 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
if (m_pD3DEx) {
if (FAILED(hr = m_pD3DEx->CreateDeviceEx(m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_ENABLE_PRESENTSTATS,
- &pp, NULL, &m_pD3DDevEx))) {
+ &pp, nullptr, &m_pD3DDevEx))) {
_Error += GetWindowsErrorMessage(hr, m_hD3D9);
return hr;
}
@@ -616,11 +616,11 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
CComPtr<ISubPicProvider> pSubPicProvider;
if (m_pSubPicQueue) {
- DEBUG_ONLY(_tprintf_s(_T("m_pSubPicQueue != NULL\n")));
+ DEBUG_ONLY(_tprintf_s(_T("m_pSubPicQueue != nullptr\n")));
m_pSubPicQueue->GetSubPicProvider(&pSubPicProvider);
}
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
m_pSubPicQueue = GetRenderersSettings().nSPCSize > 0
? (ISubPicQueue*)DEBUG_NEW CSubPicQueue(GetRenderersSettings().nSPCSize, !GetRenderersSettings().fSPCAllowAnimationWhenBuffering, m_pAllocator, &hr)
: (ISubPicQueue*)DEBUG_NEW CSubPicQueueNoThread(m_pAllocator, &hr);
@@ -679,7 +679,7 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
while (hr = rendererInputEnum->Next(1, &input.p, 0), hr == S_OK) { // Must have .p here
DEBUG_ONLY(_tprintf_s(_T("Pin found\n")));
input->ConnectedTo(&output.p);
- if (output != NULL) {
+ if (output != nullptr) {
rendererInput.push_back(input);
decoderOutput.push_back(output);
}
@@ -699,10 +699,10 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
}
// Release more resources
- m_pSubPicQueue = NULL;
- m_pFont = NULL;
- m_pSprite = NULL;
- m_pLine = NULL;
+ m_pSubPicQueue = nullptr;
+ m_pFont = nullptr;
+ m_pSprite = nullptr;
+ m_pLine = nullptr;
m_pPSC.Free();
m_pResizerPixelShader[0] = 0;
@@ -713,12 +713,12 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
POSITION pos = m_pPixelShadersScreenSpace.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pPixelShadersScreenSpace.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
pos = m_pPixelShaders.GetHeadPosition();
while (pos) {
CExternalPixelShader& Shader = m_pPixelShaders.GetNext(pos);
- Shader.m_pPixelShader = NULL;
+ Shader.m_pPixelShader = nullptr;
}
D3DDISPLAYMODE d3ddm;
@@ -760,7 +760,7 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
ZeroMemory(&DisplayMode, sizeof(DisplayMode));
DisplayMode.Size = sizeof(DisplayMode);
if (m_pD3DDevEx) {
- m_pD3DEx->GetAdapterDisplayModeEx(GetAdapter(m_pD3DEx, m_hWnd), &DisplayMode, NULL);
+ m_pD3DEx->GetAdapterDisplayModeEx(GetAdapter(m_pD3DEx, m_hWnd), &DisplayMode, nullptr);
DisplayMode.Format = pp.BackBufferFormat;
pp.FullScreen_RefreshRateInHz = DisplayMode.RefreshRate;
if (FAILED(m_pD3DDevEx->Reset(&pp))) {
@@ -813,12 +813,12 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
if (disconnected) {
for (DWORD i = 0; i < decoderOutput.size(); i++) {
- if (FAILED(filterInfo.pGraph->ConnectDirect(decoderOutput.at(i).p, rendererInput.at(i).p, NULL))) {
+ if (FAILED(filterInfo.pGraph->ConnectDirect(decoderOutput.at(i).p, rendererInput.at(i).p, nullptr))) {
return hr;
}
}
- if (filterInfo.pGraph != NULL) {
+ if (filterInfo.pGraph != nullptr) {
filterInfo.pGraph->Release();
}
}
@@ -897,7 +897,7 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
m_pSubPicQueue->SetSubPicProvider(pSubPicProvider);
}
- m_pFont = NULL;
+ m_pFont = nullptr;
if (m_pD3DXCreateFont) {
int MinSize = 1600;
int CurrentSize = min(m_ScreenSize.cx, MinSize);
@@ -906,11 +906,11 @@ HRESULT CBaseAP::ResetDXDevice(CString& _Error)
m_pD3DXCreateFont(m_pD3DDev, (int)(-24.0 * Scale), (UINT)(-11.0 * Scale), CurrentSize < 800 ? FW_NORMAL : FW_BOLD, 0, FALSE,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE, L"Lucida Console", &m_pFont);
}
- m_pSprite = NULL;
+ m_pSprite = nullptr;
if (m_pD3DXCreateSprite) {
m_pD3DXCreateSprite(m_pD3DDev, &m_pSprite);
}
- m_pLine = NULL;
+ m_pLine = nullptr;
if (m_pD3DXCreateLine) {
m_pD3DXCreateLine(m_pD3DDev, &m_pLine);
}
@@ -925,12 +925,12 @@ HRESULT CBaseAP::AllocSurfaces(D3DFORMAT Format)
const CRenderersSettings& s = GetRenderersSettings();
for (int i = 0; i < m_nDXSurface + 2; i++) {
- m_pVideoTexture[i] = NULL;
- m_pVideoSurface[i] = NULL;
+ m_pVideoTexture[i] = nullptr;
+ m_pVideoSurface[i] = nullptr;
}
- m_pScreenSizeTemporaryTexture[0] = NULL;
- m_pScreenSizeTemporaryTexture[1] = NULL;
+ m_pScreenSizeTemporaryTexture[0] = nullptr;
+ m_pScreenSizeTemporaryTexture[1] = nullptr;
m_SurfaceType = Format;
HRESULT hr;
@@ -946,7 +946,7 @@ HRESULT CBaseAP::AllocSurfaces(D3DFORMAT Format)
Format,
D3DPOOL_DEFAULT,
&m_pVideoTexture[i],
- NULL))) {
+ nullptr))) {
return hr;
}
@@ -956,16 +956,16 @@ HRESULT CBaseAP::AllocSurfaces(D3DFORMAT Format)
}
if (s.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D) {
for (int i = 0; i < m_nDXSurface + 2; i++) {
- m_pVideoTexture[i] = NULL;
+ m_pVideoTexture[i] = nullptr;
}
}
} else {
- if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &m_pVideoSurface[m_nCurSurface], NULL))) {
+ if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(m_NativeVideoSize.cx, m_NativeVideoSize.cy, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &m_pVideoSurface[m_nCurSurface], nullptr))) {
return hr;
}
}
- hr = m_pD3DDev->ColorFill(m_pVideoSurface[m_nCurSurface], NULL, 0);
+ hr = m_pD3DDev->ColorFill(m_pVideoSurface[m_nCurSurface], nullptr, 0);
return S_OK;
}
@@ -975,8 +975,8 @@ void CBaseAP::DeleteSurfaces()
CAutoLock cRenderLock(&m_allocatorLock);
for (int i = 0; i < m_nDXSurface + 2; i++) {
- m_pVideoTexture[i] = NULL;
- m_pVideoSurface[i] = NULL;
+ m_pVideoTexture[i] = nullptr;
+ m_pVideoSurface[i] = nullptr;
}
}
@@ -1069,11 +1069,11 @@ HRESULT CBaseAP::InitResizers(float bicubicA, bool bNeedScreenSizeTexture)
} while (0);
m_bicubicA = bicubicA;
- m_pScreenSizeTemporaryTexture[0] = NULL;
- m_pScreenSizeTemporaryTexture[1] = NULL;
+ m_pScreenSizeTemporaryTexture[0] = nullptr;
+ m_pScreenSizeTemporaryTexture[1] = nullptr;
for (int i = 0; i < _countof(m_pResizerPixelShader); i++) {
- m_pResizerPixelShader[i] = NULL;
+ m_pResizerPixelShader[i] = nullptr;
}
if (m_caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) {
@@ -1113,9 +1113,9 @@ HRESULT CBaseAP::InitResizers(float bicubicA, bool bNeedScreenSizeTexture)
D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT,
&m_pScreenSizeTemporaryTexture[0],
- NULL))) {
+ nullptr))) {
ASSERT(0);
- m_pScreenSizeTemporaryTexture[0] = NULL; // will do 1 pass then
+ m_pScreenSizeTemporaryTexture[0] = nullptr; // will do 1 pass then
}
}
if (m_bicubicA || bNeedScreenSizeTexture) {
@@ -1127,9 +1127,9 @@ HRESULT CBaseAP::InitResizers(float bicubicA, bool bNeedScreenSizeTexture)
D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT,
&m_pScreenSizeTemporaryTexture[1],
- NULL))) {
+ nullptr))) {
ASSERT(0);
- m_pScreenSizeTemporaryTexture[1] = NULL; // will do 1 pass then
+ m_pScreenSizeTemporaryTexture[1] = nullptr; // will do 1 pass then
}
}
return S_OK;
@@ -1199,7 +1199,7 @@ HRESULT CBaseAP::TextureResize(IDirect3DTexture9* pTexture, Vector dst[4], D3DTE
};
AdjustQuad(v, 0, 0);
hr = m_pD3DDev->SetTexture(0, pTexture);
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
hr = TextureBlt(m_pD3DDev, v, filter);
return hr;
}
@@ -1233,7 +1233,7 @@ HRESULT CBaseAP::TextureResizeBilinear(IDirect3DTexture9* pTexture, Vector dst[4
hr = m_pD3DDev->SetTexture(0, pTexture);
hr = m_pD3DDev->SetPixelShader(m_pResizerPixelShader[0]);
hr = TextureBlt(m_pD3DDev, v, D3DTEXF_POINT);
- m_pD3DDev->SetPixelShader(NULL);
+ m_pD3DDev->SetPixelShader(nullptr);
return hr;
}
@@ -1266,7 +1266,7 @@ HRESULT CBaseAP::TextureResizeBicubic1pass(IDirect3DTexture9* pTexture, Vector d
hr = m_pD3DDev->SetPixelShaderConstantF(0, (float*)fConstData, _countof(fConstData));
hr = m_pD3DDev->SetPixelShader(m_pResizerPixelShader[1]);
hr = TextureBlt(m_pD3DDev, v, D3DTEXF_POINT);
- m_pD3DDev->SetPixelShader(NULL);
+ m_pD3DDev->SetPixelShader(nullptr);
return hr;
}
@@ -1351,7 +1351,7 @@ HRESULT CBaseAP::TextureResizeBicubic2pass(IDirect3DTexture9* pTexture, Vector d
hr = m_pD3DDev->SetTexture(0, m_pScreenSizeTemporaryTexture[0]);
hr = m_pD3DDev->SetRenderTarget(0, pRTOld);
hr = TextureBlt(m_pD3DDev, vy, D3DTEXF_POINT);
- m_pD3DDev->SetPixelShader(NULL);
+ m_pD3DDev->SetPixelShader(nullptr);
return hr;*/
}
@@ -1427,12 +1427,12 @@ HRESULT CBaseAP::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9* pTexture)
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
hr = m_pD3DDev->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1);
hr = m_pD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(pVertices[0]));
- m_pD3DDev->SetTexture(0, NULL);
+ m_pD3DDev->SetTexture(0, nullptr);
m_pD3DDev->SetRenderState(D3DRS_ALPHABLENDENABLE, abe);
m_pD3DDev->SetRenderState(D3DRS_SRCBLEND, sb);
@@ -1572,7 +1572,7 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
CComPtr<IDirect3DSurface9> pBackBuffer;
m_pD3DDev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer);
m_pD3DDev->SetRenderTarget(0, pBackBuffer);
- hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0);
+ hr = m_pD3DDev->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1.0f, 0);
if (!rDstVid.IsRectEmpty()) {
if (m_pVideoTexture[m_nCurSurface]) {
CComPtr<IDirect3DTexture9> pVideoTexture = m_pVideoTexture[m_nCurSurface];
@@ -1622,7 +1622,7 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
}
hr = m_pD3DDev->SetRenderTarget(0, pRT);
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
}
Vector dst[4];
@@ -1662,7 +1662,7 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
if (hr != S_OK) {
bScreenSpacePixelShaders = false;
}
- hr = m_pD3DDev->Clear(0, NULL, D3DCLEAR_TARGET, 0, 1.0f, 0);
+ hr = m_pD3DDev->Clear(0, nullptr, D3DCLEAR_TARGET, 0, 1.0f, 0);
}
}
@@ -1722,7 +1722,7 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
std::swap(src, dst);
}
- hr = m_pD3DDev->SetPixelShader(NULL);
+ hr = m_pD3DDev->SetPixelShader(nullptr);
}
} else {
if (pBackBuffer) {
@@ -1743,10 +1743,10 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
if (m_VMR9AlphaBitmap.dwFlags & VMRBITMAP_UPDATE) {
CAutoLock BitMapLock(&m_VMR9AlphaBitmapLock);
CRect rcSrc(m_VMR9AlphaBitmap.rSrc);
- m_pOSDTexture = NULL;
- m_pOSDSurface = NULL;
+ m_pOSDTexture = nullptr;
+ m_pOSDSurface = nullptr;
if ((m_VMR9AlphaBitmap.dwFlags & VMRBITMAP_DISABLE) == 0 && (BYTE*)m_VMR9AlphaBitmapData) {
- if ((m_pD3DXLoadSurfaceFromMemory != NULL) &&
+ if ((m_pD3DXLoadSurfaceFromMemory != nullptr) &&
SUCCEEDED(hr = m_pD3DDev->CreateTexture(
rcSrc.Width(),
rcSrc.Height(),
@@ -1755,14 +1755,14 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT,
&m_pOSDTexture,
- NULL))) {
+ nullptr))) {
if (SUCCEEDED(hr = m_pOSDTexture->GetSurfaceLevel(0, &m_pOSDSurface))) {
- hr = m_pD3DXLoadSurfaceFromMemory(m_pOSDSurface, NULL, NULL, (BYTE*)m_VMR9AlphaBitmapData, D3DFMT_A8R8G8B8, m_VMR9AlphaBitmapWidthBytes,
- NULL, &m_VMR9AlphaBitmapRect, D3DX_FILTER_NONE, m_VMR9AlphaBitmap.clrSrcKey);
+ hr = m_pD3DXLoadSurfaceFromMemory(m_pOSDSurface, nullptr, nullptr, (BYTE*)m_VMR9AlphaBitmapData, D3DFMT_A8R8G8B8, m_VMR9AlphaBitmapWidthBytes,
+ nullptr, &m_VMR9AlphaBitmapRect, D3DX_FILTER_NONE, m_VMR9AlphaBitmap.clrSrcKey);
}
if (FAILED(hr)) {
- m_pOSDTexture = NULL;
- m_pOSDSurface = NULL;
+ m_pOSDTexture = nullptr;
+ m_pOSDSurface = nullptr;
}
}
}
@@ -1778,15 +1778,15 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
if (m_pD3DDevEx) {
if (m_bIsFullscreen) {
- hr = m_pD3DDevEx->PresentEx(NULL, NULL, NULL, NULL, NULL);
+ hr = m_pD3DDevEx->PresentEx(nullptr, nullptr, nullptr, nullptr, 0);
} else {
- hr = m_pD3DDevEx->PresentEx(rSrcPri, rDstPri, NULL, NULL, NULL);
+ hr = m_pD3DDevEx->PresentEx(rSrcPri, rDstPri, nullptr, nullptr, 0);
}
} else {
if (m_bIsFullscreen) {
- hr = m_pD3DDev->Present(NULL, NULL, NULL, NULL);
+ hr = m_pD3DDev->Present(nullptr, nullptr, nullptr, nullptr);
} else {
- hr = m_pD3DDev->Present(rSrcPri, rDstPri, NULL, NULL);
+ hr = m_pD3DDev->Present(rSrcPri, rDstPri, nullptr, nullptr);
}
}
if (FAILED(hr)) {
@@ -1831,7 +1831,7 @@ STDMETHODIMP_(bool) CBaseAP::Paint(bool fAll)
// Check how well audio is matching rate (if at all)
DWORD tmp;
- if (m_pAudioStats != NULL) {
+ if (m_pAudioStats != nullptr) {
m_pAudioStats->GetStatParam(AM_AUDREND_STAT_PARAM_SLAVE_ACCUMERROR, &m_lAudioLag, &tmp);
m_lAudioLagMin = min((long)m_lAudioLag, m_lAudioLagMin);
m_lAudioLagMax = max((long)m_lAudioLag, m_lAudioLagMax);
@@ -2333,11 +2333,11 @@ STDMETHODIMP CBaseAP::GetDIB(BYTE* lpDib, DWORD* size)
CComPtr<IDirect3DSurface9> pSurface = m_pVideoSurface[m_nCurSurface];
D3DLOCKED_RECT r;
- if (FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
- pSurface = NULL;
- if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, NULL))
+ if (FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
+ pSurface = nullptr;
+ if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pSurface, nullptr))
|| FAILED(hr = m_pD3DDev->GetRenderTargetData(m_pVideoSurface[m_nCurSurface], pSurface))
- || FAILED(hr = pSurface->LockRect(&r, NULL, D3DLOCK_READONLY))) {
+ || FAILED(hr = pSurface->LockRect(&r, nullptr, D3DLOCK_READONLY))) {
return hr;
}
}
@@ -2379,7 +2379,7 @@ STDMETHODIMP CBaseAP::SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScr
if (!pSrcData && !pTarget) {
pPixelShaders->RemoveAll();
- m_pD3DDev->SetPixelShader(NULL);
+ m_pD3DDev->SetPixelShader(nullptr);
return S_OK;
}
@@ -2405,9 +2405,9 @@ STDMETHODIMP CBaseAP::SetPixelShader2(LPCSTR pSrcData, LPCSTR pTarget, bool bScr
CSyncAP::CSyncAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
: CBaseAP(hWnd, bFullscreen, hr, _Error)
- , m_hDXVA2Lib(NULL)
- , m_hEVRLib(NULL)
- , m_hAVRTLib(NULL)
+ , m_hDXVA2Lib(nullptr)
+ , m_hEVRLib(nullptr)
+ , m_hAVRTLib(nullptr)
{
const CRenderersSettings& s = GetRenderersSettings();
@@ -2427,13 +2427,13 @@ CSyncAP::CSyncAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
// Load EVR specific DLLs
m_hDXVA2Lib = LoadLibrary(L"dxva2.dll");
- pfDXVA2CreateDirect3DDeviceManager9 = m_hDXVA2Lib ? (PTR_DXVA2CreateDirect3DDeviceManager9) GetProcAddress(m_hDXVA2Lib, "DXVA2CreateDirect3DDeviceManager9") : NULL;
+ pfDXVA2CreateDirect3DDeviceManager9 = m_hDXVA2Lib ? (PTR_DXVA2CreateDirect3DDeviceManager9) GetProcAddress(m_hDXVA2Lib, "DXVA2CreateDirect3DDeviceManager9") : nullptr;
// Load EVR functions
m_hEVRLib = LoadLibrary(L"evr.dll");
- pfMFCreateDXSurfaceBuffer = m_hEVRLib ? (PTR_MFCreateDXSurfaceBuffer)GetProcAddress(m_hEVRLib, "MFCreateDXSurfaceBuffer") : NULL;
- pfMFCreateVideoSampleFromSurface = m_hEVRLib ? (PTR_MFCreateVideoSampleFromSurface)GetProcAddress(m_hEVRLib, "MFCreateVideoSampleFromSurface") : NULL;
- pfMFCreateVideoMediaType = m_hEVRLib ? (PTR_MFCreateVideoMediaType)GetProcAddress(m_hEVRLib, "MFCreateVideoMediaType") : NULL;
+ pfMFCreateDXSurfaceBuffer = m_hEVRLib ? (PTR_MFCreateDXSurfaceBuffer)GetProcAddress(m_hEVRLib, "MFCreateDXSurfaceBuffer") : nullptr;
+ pfMFCreateVideoSampleFromSurface = m_hEVRLib ? (PTR_MFCreateVideoSampleFromSurface)GetProcAddress(m_hEVRLib, "MFCreateVideoSampleFromSurface") : nullptr;
+ pfMFCreateVideoMediaType = m_hEVRLib ? (PTR_MFCreateVideoMediaType)GetProcAddress(m_hEVRLib, "MFCreateVideoMediaType") : nullptr;
if (!pfDXVA2CreateDirect3DDeviceManager9 || !pfMFCreateDXSurfaceBuffer || !pfMFCreateVideoSampleFromSurface || !pfMFCreateVideoMediaType) {
if (!pfDXVA2CreateDirect3DDeviceManager9) {
@@ -2454,9 +2454,9 @@ CSyncAP::CSyncAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
// Load Vista specific DLLs
m_hAVRTLib = LoadLibrary(L"avrt.dll");
- pfAvSetMmThreadCharacteristicsW = m_hAVRTLib ? (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress(m_hAVRTLib, "AvSetMmThreadCharacteristicsW") : NULL;
- pfAvSetMmThreadPriority = m_hAVRTLib ? (PTR_AvSetMmThreadPriority) GetProcAddress(m_hAVRTLib, "AvSetMmThreadPriority") : NULL;
- pfAvRevertMmThreadCharacteristics = m_hAVRTLib ? (PTR_AvRevertMmThreadCharacteristics) GetProcAddress(m_hAVRTLib, "AvRevertMmThreadCharacteristics") : NULL;
+ pfAvSetMmThreadCharacteristicsW = m_hAVRTLib ? (PTR_AvSetMmThreadCharacteristicsW) GetProcAddress(m_hAVRTLib, "AvSetMmThreadCharacteristicsW") : nullptr;
+ pfAvSetMmThreadPriority = m_hAVRTLib ? (PTR_AvSetMmThreadPriority) GetProcAddress(m_hAVRTLib, "AvSetMmThreadPriority") : nullptr;
+ pfAvRevertMmThreadCharacteristics = m_hAVRTLib ? (PTR_AvRevertMmThreadCharacteristics) GetProcAddress(m_hAVRTLib, "AvRevertMmThreadCharacteristics") : nullptr;
// Init DXVA manager
hr = pfDXVA2CreateDirect3DDeviceManager9(&m_nResetToken, &m_pD3DManager);
@@ -2490,12 +2490,12 @@ CSyncAP::CSyncAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
m_LastSetOutputRange = -1;
m_bPendingRenegotiate = false;
m_bPendingMediaFinished = false;
- m_pCurrentDisplaydSample = NULL;
+ m_pCurrentDisplaydSample = nullptr;
m_nStepCount = 0;
m_dwVideoAspectRatioMode = MFVideoARMode_PreservePicture;
m_dwVideoRenderPrefs = (MFVideoRenderPrefs)0;
m_BorderColor = RGB(0, 0, 0);
- m_pOuterEVR = NULL;
+ m_pOuterEVR = nullptr;
m_bPrerolled = false;
m_lShiftToNearest = -1; // Illegal value to start with
}
@@ -2503,9 +2503,9 @@ CSyncAP::CSyncAP(HWND hWnd, bool bFullscreen, HRESULT& hr, CString& _Error)
CSyncAP::~CSyncAP()
{
StopWorkerThreads();
- m_pMediaType = NULL;
- m_pClock = NULL;
- m_pD3DManager = NULL;
+ m_pMediaType = nullptr;
+ m_pClock = nullptr;
+ m_pD3DManager = nullptr;
if (m_hDXVA2Lib) {
FreeLibrary(m_hDXVA2Lib);
@@ -2531,12 +2531,12 @@ void CSyncAP::StartWorkerThreads()
{
DWORD dwThreadId;
if (m_nRenderState == Shutdown) {
- m_hEvtQuit = CreateEvent(NULL, TRUE, FALSE, NULL);
- m_hEvtFlush = CreateEvent(NULL, TRUE, FALSE, NULL);
- m_hEvtSkip = CreateEvent(NULL, TRUE, FALSE, NULL);
- m_hMixerThread = ::CreateThread(NULL, 0, MixerThreadStatic, (LPVOID)this, 0, &dwThreadId);
+ m_hEvtQuit = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ m_hEvtFlush = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ m_hEvtSkip = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ m_hMixerThread = ::CreateThread(nullptr, 0, MixerThreadStatic, (LPVOID)this, 0, &dwThreadId);
SetThreadPriority(m_hMixerThread, THREAD_PRIORITY_HIGHEST);
- m_hRenderThread = ::CreateThread(NULL, 0, RenderThreadStatic, (LPVOID)this, 0, &dwThreadId);
+ m_hRenderThread = ::CreateThread(nullptr, 0, RenderThreadStatic, (LPVOID)this, 0, &dwThreadId);
SetThreadPriority(m_hRenderThread, THREAD_PRIORITY_TIME_CRITICAL);
m_nRenderState = Stopped;
}
@@ -2586,11 +2586,11 @@ void CSyncAP::StopWorkerThreads()
STDMETHODIMP CSyncAP::CreateRenderer(IUnknown** ppRenderer)
{
CheckPointer(ppRenderer, E_POINTER);
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
HRESULT hr = E_FAIL;
do {
- CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL);
+ CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), nullptr);
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK;
CSyncRenderer* pOuterEVR = DEBUG_NEW CSyncRenderer(NAME("CSyncRenderer"), pUnk, hr, &m_VMR9AlphaBitmap, this);
@@ -2620,7 +2620,7 @@ STDMETHODIMP CSyncAP::CreateRenderer(IUnknown** ppRenderer)
hr = QueryInterface(__uuidof(IMFVideoPresenter), (void**)&pVP);
}
if (SUCCEEDED(hr)) {
- hr = pMFVR->InitializeRenderer(NULL, pVP);
+ hr = pMFVR->InitializeRenderer(nullptr, pVP);
}
CComPtr<IPin> pPin = GetFirstPin(pBF);
@@ -2628,7 +2628,7 @@ STDMETHODIMP CSyncAP::CreateRenderer(IUnknown** ppRenderer)
m_bUseInternalTimer = HookNewSegmentAndReceive((IPinC*)(IPin*)pPin, (IMemInputPinC*)(IMemInputPin*)pMemInputPin);
if (FAILED(hr)) {
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
} else {
*ppRenderer = pBF.Detach();
}
@@ -2821,7 +2821,7 @@ STDMETHODIMP CSyncAP::IsRateSupported(BOOL fThin, float flRate, float* pflNeares
}
}
// Return the nearest supported rate if the caller requested it.
- if (pflNearestSupportedRate != NULL) {
+ if (pflNearestSupportedRate != nullptr) {
*pflNearestSupportedRate = fNearestRate;
}
return hr;
@@ -2833,7 +2833,7 @@ float CSyncAP::GetMaxRate(BOOL bThin)
UINT32 fpsNumerator = 0, fpsDenominator = 0;
UINT MonitorRateHz = 0;
- if (!bThin && (m_pMediaType != NULL)) {
+ if (!bThin && (m_pMediaType != nullptr)) {
// Non-thinned: Use the frame rate and monitor refresh rate.
// Frame rate:
@@ -2887,7 +2887,7 @@ STDMETHODIMP CSyncAP::ProcessMessage(MFVP_MESSAGE_TYPE eMessage, ULONG_PTR ulPar
case MFVP_MESSAGE_ENDSTREAMING:
m_pGenlock->ResetTiming();
- m_pRefClock = NULL;
+ m_pRefClock = nullptr;
break;
case MFVP_MESSAGE_FLUSH:
@@ -2939,7 +2939,7 @@ HRESULT CSyncAP::IsMediaTypeSupported(IMFMediaType* pMixerType)
HRESULT CSyncAP::CreateProposedOutputType(IMFMediaType* pMixerType, IMFMediaType** pType)
{
HRESULT hr;
- AM_MEDIA_TYPE* pAMMedia = NULL;
+ AM_MEDIA_TYPE* pAMMedia = nullptr;
LARGE_INTEGER i64Size;
MFVIDEOFORMAT* VideoFormat;
@@ -3005,7 +3005,7 @@ HRESULT CSyncAP::CreateProposedOutputType(IMFMediaType* pMixerType, IMFMediaType
HRESULT CSyncAP::SetMediaType(IMFMediaType* pType)
{
HRESULT hr;
- AM_MEDIA_TYPE* pAMMedia = NULL;
+ AM_MEDIA_TYPE* pAMMedia = nullptr;
CString strTemp;
CheckPointer(pType, E_POINTER);
@@ -3030,7 +3030,7 @@ typedef struct {
LONGLONG CSyncAP::GetMediaTypeMerit(IMFMediaType* pMediaType)
{
- AM_MEDIA_TYPE* pAMMedia = NULL;
+ AM_MEDIA_TYPE* pAMMedia = nullptr;
MFVIDEOFORMAT* VideoFormat;
HRESULT hr;
@@ -3081,9 +3081,9 @@ HRESULT CSyncAP::RenegotiateMediaType()
// Loop through all of the mixer's proposed output types.
DWORD iTypeIndex = 0;
while ((hr != MF_E_NO_MORE_TYPES)) {
- pMixerType = NULL;
- pType = NULL;
- m_pMediaType = NULL;
+ pMixerType = nullptr;
+ pType = nullptr;
+ m_pMediaType = nullptr;
// Step 1. Get the next media type supported by mixer.
hr = m_pMixer->GetOutputAvailableType(0, iTypeIndex++, &pMixerType);
@@ -3131,15 +3131,15 @@ HRESULT CSyncAP::RenegotiateMediaType()
hr = m_pMixer->SetOutputType(0, pType, 0);
// If something went wrong, clear the media type.
if (FAILED(hr)) {
- SetMediaType(NULL);
+ SetMediaType(nullptr);
} else {
break;
}
}
}
- pMixerType = NULL;
- pType = NULL;
+ pMixerType = nullptr;
+ pType = nullptr;
return hr;
}
@@ -3208,7 +3208,7 @@ STDMETHODIMP CSyncAP::GetCurrentMediaType(__deref_out IMFVideoMediaType** ppMed
CheckPointer(ppMediaType, E_POINTER);
CHECK_HR(CheckShutdown());
- if (m_pMediaType == NULL) {
+ if (m_pMediaType == nullptr) {
CHECK_HR(MF_E_NOT_INITIALIZED);
}
@@ -3231,9 +3231,9 @@ STDMETHODIMP CSyncAP::InitServicePointers(__in IMFTopologyServiceLookup* pLookup
STDMETHODIMP CSyncAP::ReleaseServicePointers()
{
StopWorkerThreads();
- m_pMixer = NULL;
- m_pSink = NULL;
- m_pClock = NULL;
+ m_pMixer = nullptr;
+ m_pSink = nullptr;
+ m_pClock = nullptr;
return S_OK;
}
@@ -3589,7 +3589,7 @@ void CSyncAP::RenderThread()
DWORD dwUser = 0;
DWORD dwObject;
int nSamplesLeft;
- CComPtr<IMFSample>pNewSample = NULL; // The sample next in line to be presented
+ CComPtr<IMFSample>pNewSample = nullptr; // The sample next in line to be presented
// Tell Vista Multimedia Class Scheduler we are doing threaded playback (increase priority)
HANDLE hAvrt = 0;
@@ -3605,7 +3605,7 @@ void CSyncAP::RenderThread()
timeGetDevCaps(&tc, sizeof(TIMECAPS));
dwResolution = min(max(tc.wPeriodMin, 0), tc.wPeriodMax);
dwUser = timeBeginPeriod(dwResolution);
- pNewSample = NULL;
+ pNewSample = nullptr;
while (!bQuit) {
m_lNextSampleWait = 1; // Default value for running this loop
@@ -3627,7 +3627,7 @@ void CSyncAP::RenderThread()
} else if (SUCCEEDED(pNewSample->GetSampleTime(&m_llSampleTime))) { // Get zero-based sample due time
if (m_llLastSampleTime == m_llSampleTime) { // In the rare case there are duplicate frames in the movie. There really shouldn't be but it happens.
MoveToFreeList(pNewSample, true);
- pNewSample = NULL;
+ pNewSample = nullptr;
m_lNextSampleWait = 0;
} else {
m_pClock->GetCorrelatedTime(0, &llRefClockTime, &llSystemTime); // Get zero-based reference clock time. llSystemTime is not used for anything here
@@ -3714,7 +3714,7 @@ void CSyncAP::RenderThread()
if (pNewSample) {
MoveToFreeList(pNewSample, true);
}
- pNewSample = NULL;
+ pNewSample = nullptr;
FlushSamples();
m_bEvtFlush = false;
ResetEvent(m_hEvtFlush);
@@ -3736,7 +3736,7 @@ void CSyncAP::RenderThread()
if (pNewSample) {
MoveToFreeList(pNewSample, true);
}
- pNewSample = NULL;
+ pNewSample = nullptr;
FlushSamples();
RenegotiateMediaType();
m_bPendingRenegotiate = false;
@@ -3746,7 +3746,7 @@ void CSyncAP::RenderThread()
if (pNewSample) {
MoveToFreeList(pNewSample, true);
}
- pNewSample = NULL;
+ pNewSample = nullptr;
SendResetRequest();
} else if (m_nStepCount < 0) {
m_nStepCount = 0;
@@ -3774,12 +3774,12 @@ void CSyncAP::RenderThread()
} // switch
if (pNewSample && stepForward) {
MoveToFreeList(pNewSample, true);
- pNewSample = NULL;
+ pNewSample = nullptr;
}
} // while
if (pNewSample) {
MoveToFreeList(pNewSample, true);
- pNewSample = NULL;
+ pNewSample = nullptr;
}
timeEndPeriod(dwResolution);
if (pfAvRevertMmThreadCharacteristics) {
@@ -3952,10 +3952,10 @@ HRESULT CreateSyncRenderer(const CLSID& clsid, HWND hWnd, bool bFullscreen, ISub
if (FAILED(hr)) {
Error += L"\n";
- Error += GetWindowsErrorMessage(hr, NULL);
+ Error += GetWindowsErrorMessage(hr, nullptr);
MessageBox(hWnd, Error, L"Error creating EVR Sync", MB_OK | MB_ICONERROR);
(*ppAP)->Release();
- *ppAP = NULL;
+ *ppAP = nullptr;
} else if (!Error.IsEmpty()) {
MessageBox(hWnd, Error, L"Warning creating EVR Sync", MB_OK | MB_ICONWARNING);
}
@@ -4200,7 +4200,7 @@ CGenlock::CGenlock(double target, double limit, int lineD, int colD, double cloc
displayFreqFaster = 0;
displayFreqSlower = 0;
curDisplayFreq = 0;
- psWnd = NULL;
+ psWnd = nullptr;
liveSource = FALSE;
powerstripTimingExists = FALSE;
syncOffsetFifo = DEBUG_NEW MovingAverage(64);
@@ -4212,12 +4212,12 @@ CGenlock::~CGenlock()
ResetTiming();
SAFE_DELETE(syncOffsetFifo);
SAFE_DELETE(frameCycleFifo);
- syncClock = NULL;
+ syncClock = nullptr;
};
BOOL CGenlock::PowerstripRunning()
{
- psWnd = FindWindow(_T("TPShidden"), NULL);
+ psWnd = FindWindow(_T("TPShidden"), nullptr);
if (!psWnd) {
return FALSE; // Powerstrip is not running
} else {
@@ -4229,7 +4229,7 @@ BOOL CGenlock::PowerstripRunning()
HRESULT CGenlock::GetTiming()
{
ATOM getTiming;
- LPARAM lParam = NULL;
+ LPARAM lParam = 0;
WPARAM wParam = monitor;
int i = 0;
int j = 0;
@@ -4317,7 +4317,7 @@ HRESULT CGenlock::GetTiming()
// Reset display timing parameters to nominal.
HRESULT CGenlock::ResetTiming()
{
- LPARAM lParam = NULL;
+ LPARAM lParam = 0;
WPARAM wParam = monitor;
ATOM setTiming;
LRESULT ret;
@@ -4342,7 +4342,7 @@ HRESULT CGenlock::ResetTiming()
HRESULT CGenlock::ResetClock()
{
adjDelta = 0;
- if (syncClock == NULL) {
+ if (syncClock == nullptr) {
return E_FAIL;
} else {
return syncClock->AdjustClock(1.0);
@@ -4388,7 +4388,7 @@ HRESULT CGenlock::AdviseSyncClock(ISyncClock* sC)
return E_FAIL;
}
if (syncClock) {
- syncClock = NULL; // Release any outstanding references if this is called repeatedly
+ syncClock = nullptr; // Release any outstanding references if this is called repeatedly
}
syncClock = sC;
return S_OK;
@@ -4418,7 +4418,7 @@ HRESULT CGenlock::ResetStats()
// Synchronize by adjusting display refresh rate
HRESULT CGenlock::ControlDisplay(double syncOffset, double frameCycle)
{
- LPARAM lParam = NULL;
+ LPARAM lParam = 0;
WPARAM wParam = monitor;
ATOM setTiming;
diff --git a/src/filters/renderer/VideoRenderers/VMR7AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR7AllocatorPresenter.cpp
index 4eb50c8ab..2c6dcf417 100644
--- a/src/filters/renderer/VideoRenderers/VMR7AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/VMR7AllocatorPresenter.cpp
@@ -93,7 +93,7 @@ STDMETHODIMP CVMR7AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
{
CheckPointer(ppRenderer, E_POINTER);
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
HRESULT hr;
CComPtr<IBaseFilter> pBF;
@@ -178,7 +178,7 @@ STDMETHODIMP CVMR7AllocatorPresenter::AllocateSurface(DWORD_PTR dwUserID, VMRALL
}
// test if the colorspace is acceptable
- if (FAILED(hr = m_pVideoSurface->Blt(NULL, *lplpSurface, NULL, DDBLT_WAIT, NULL))) {
+ if (FAILED(hr = m_pVideoSurface->Blt(nullptr, *lplpSurface, nullptr, DDBLT_WAIT, nullptr))) {
DeleteSurfaces();
return hr;
}
@@ -186,7 +186,7 @@ STDMETHODIMP CVMR7AllocatorPresenter::AllocateSurface(DWORD_PTR dwUserID, VMRALL
DDBLTFX fx;
INITDDSTRUCT(fx);
fx.dwFillColor = 0;
- m_pVideoSurface->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
+ m_pVideoSurface->Blt(nullptr, nullptr, nullptr, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
return hr;
}
@@ -256,7 +256,7 @@ STDMETHODIMP CVMR7AllocatorPresenter::PresentImage(DWORD_PTR dwUserID, VMRPRESEN
CAutoLock cAutoLock(this);
if (!m_bPendingResetDevice) {
- m_pVideoSurface->Blt(NULL, lpPresInfo->lpSurf, NULL, DDBLT_WAIT, NULL);
+ m_pVideoSurface->Blt(nullptr, lpPresInfo->lpSurf, nullptr, DDBLT_WAIT, nullptr);
}
if (lpPresInfo->rtEnd > lpPresInfo->rtStart) {
@@ -333,7 +333,7 @@ STDMETHODIMP CVMR7AllocatorPresenter::GetVideoPosition(LPRECT lpSRCRect, LPRECT
CopyRect(lpSRCRect, CRect(CPoint(0, 0), m_NativeVideoSize));
CopyRect(lpDSTRect, &m_VideoRect);
// DVD Nav. bug workaround fix
- GetNativeVideoSize(&lpSRCRect->right, &lpSRCRect->bottom, NULL, NULL);
+ GetNativeVideoSize(&lpSRCRect->right, &lpSRCRect->bottom, nullptr, nullptr);
return S_OK;
}
diff --git a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
index b6928a9f3..3301ea8c4 100644
--- a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
@@ -87,10 +87,10 @@ void CVMR9AllocatorPresenter::DeleteSurfaces()
STDMETHODIMP CVMR9AllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
{
CheckPointer(ppRenderer, E_POINTER);
- *ppRenderer = NULL;
+ *ppRenderer = nullptr;
HRESULT hr;
- CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), NULL);
+ CMacrovisionKicker* pMK = DEBUG_NEW CMacrovisionKicker(NAME("CMacrovisionKicker"), nullptr);
CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pMK;
COuterVMR9* pOuter = DEBUG_NEW COuterVMR9(NAME("COuterVMR9"), pUnk, &m_VMR9AlphaBitmap, this);
@@ -227,13 +227,13 @@ STDMETHODIMP CVMR9AllocatorPresenter::InitializeDevice(DWORD_PTR dwUserID, VMR9A
if (!(lpAllocInfo->dwFlags & VMR9AllocFlag_TextureSurface)) {
// test if the colorspace is acceptable
- if (FAILED(hr = m_pD3DDev->StretchRect(m_pSurfaces[0], NULL, m_pVideoSurface[m_nCurSurface], NULL, D3DTEXF_NONE))) {
+ if (FAILED(hr = m_pD3DDev->StretchRect(m_pSurfaces[0], nullptr, m_pVideoSurface[m_nCurSurface], nullptr, D3DTEXF_NONE))) {
DeleteSurfaces();
return E_FAIL;
}
}
- hr = m_pD3DDev->ColorFill(m_pVideoSurface[m_nCurSurface], NULL, 0);
+ hr = m_pD3DDev->ColorFill(m_pVideoSurface[m_nCurSurface], nullptr, 0);
if (m_nVMR9Surfaces && m_nVMR9Surfaces != (int)*lpNumBuffers) {
m_nVMR9Surfaces = *lpNumBuffers;
@@ -443,7 +443,7 @@ STDMETHODIMP CVMR9AllocatorPresenter::PresentImage(DWORD_PTR dwUserID, VMR9Prese
m_pVideoTexture[m_nCurSurface] = pTexture;
}
} else {
- hr = m_pD3DDev->StretchRect(lpPresInfo->lpSurf, NULL, m_pVideoSurface[m_nCurSurface], NULL, D3DTEXF_NONE);
+ hr = m_pD3DDev->StretchRect(lpPresInfo->lpSurf, nullptr, m_pVideoSurface[m_nCurSurface], nullptr, D3DTEXF_NONE);
}
// Tear test bars
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
index fd86fd5ba..c3c12bc07 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -65,13 +65,13 @@ CmadVRAllocatorPresenter::~CmadVRAllocatorPresenter()
{
if (m_pSRCB) {
// nasty, but we have to let it know about our death somehow
- ((CSubRenderCallback*)(ISubRenderCallback2*)m_pSRCB)->SetDXRAP(NULL);
+ ((CSubRenderCallback*)(ISubRenderCallback2*)m_pSRCB)->SetDXRAP(nullptr);
}
// the order is important here
- m_pSubPicQueue = NULL;
- m_pAllocator = NULL;
- m_pDXR = NULL;
+ m_pSubPicQueue = nullptr;
+ m_pAllocator = nullptr;
+ m_pDXR = nullptr;
}
STDMETHODIMP CmadVRAllocatorPresenter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
@@ -102,8 +102,8 @@ HRESULT CmadVRAllocatorPresenter::SetDevice(IDirect3DDevice9* pD3DDev)
{
if (!pD3DDev) {
// release all resources
- m_pSubPicQueue = NULL;
- m_pAllocator = NULL;
+ m_pSubPicQueue = nullptr;
+ m_pAllocator = nullptr;
return S_OK;
}
@@ -197,13 +197,13 @@ STDMETHODIMP CmadVRAllocatorPresenter::CreateRenderer(IUnknown** ppRenderer)
CComQIPtr<ISubRender> pSR = m_pDXR;
if (!pSR) {
- m_pDXR = NULL;
+ m_pDXR = nullptr;
return E_FAIL;
}
m_pSRCB = DEBUG_NEW CSubRenderCallback(this);
if (FAILED(pSR->SetCallback(m_pSRCB))) {
- m_pDXR = NULL;
+ m_pDXR = nullptr;
return E_FAIL;
}
@@ -268,7 +268,7 @@ STDMETHODIMP CmadVRAllocatorPresenter::SetPixelShader(LPCSTR pSrcData, LPCSTR pT
if ((!pSrcData) && (!pTarget)) {
hr = pEPS->ClearPixelShaders(false);
} else {
- hr = pEPS->AddPixelShader(pSrcData, pTarget, ShaderStage_PreScale, NULL);
+ hr = pEPS->AddPixelShader(pSrcData, pTarget, ShaderStage_PreScale, nullptr);
}
}
return hr;
@@ -281,7 +281,7 @@ STDMETHODIMP CmadVRAllocatorPresenter::SetPixelShader2(LPCSTR pSrcData, LPCSTR p
if ((!pSrcData) && (!pTarget)) {
hr = pEPS->ClearPixelShaders(bScreenSpace);
} else {
- hr = pEPS->AddPixelShader(pSrcData, pTarget, bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale, NULL);
+ hr = pEPS->AddPixelShader(pSrcData, pTarget, bScreenSpace ? ShaderStage_PostScale : ShaderStage_PreScale, nullptr);
}
}
return hr;
diff --git a/src/filters/source/BaseSource/BaseSource.cpp b/src/filters/source/BaseSource/BaseSource.cpp
index 9029d9ad6..558450676 100644
--- a/src/filters/source/BaseSource/BaseSource.cpp
+++ b/src/filters/source/BaseSource/BaseSource.cpp
@@ -149,7 +149,7 @@ HRESULT CBaseStream::FillBuffer(IMediaSample* pSample)
return S_FALSE;
}
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
if (FAILED(hr = pSample->GetPointer(&pOut)) || !pOut) {
return S_FALSE;
}
diff --git a/src/filters/source/D2VSource/D2VSource.cpp b/src/filters/source/D2VSource/D2VSource.cpp
index bf002e91e..f466d4da9 100644
--- a/src/filters/source/D2VSource/D2VSource.cpp
+++ b/src/filters/source/D2VSource/D2VSource.cpp
@@ -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.
*
@@ -31,7 +31,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -39,7 +39,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CD2VSource>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CD2VSource>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -110,7 +110,7 @@ STDMETHODIMP CD2VSource::QueryFilterInfo(FILTER_INFO* pInfo)
CD2VStream::CD2VStream(const WCHAR* fn, CSource* pParent, HRESULT* phr)
: CBaseStream(NAME("D2VSourceStream"), pParent, phr)
- , m_pFrameBuffer(NULL)
+ , m_pFrameBuffer(nullptr)
{
CAutoLock cAutoLock(&m_cSharedState);
diff --git a/src/filters/source/DTSAC3Source/DTSAC3Source.cpp b/src/filters/source/DTSAC3Source/DTSAC3Source.cpp
index 1a2c11cb7..a242fc23f 100644
--- a/src/filters/source/DTSAC3Source/DTSAC3Source.cpp
+++ b/src/filters/source/DTSAC3Source/DTSAC3Source.cpp
@@ -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.
*
@@ -103,7 +103,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -111,7 +111,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDTSAC3Source>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDTSAC3Source>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
diff --git a/src/filters/source/FLACSource/FLACSource.cpp b/src/filters/source/FLACSource/FLACSource.cpp
index d42e759d4..a8bf5ac46 100644
--- a/src/filters/source/FLACSource/FLACSource.cpp
+++ b/src/filters/source/FLACSource/FLACSource.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2009-2012 see Authors.txt
+ * (C) 2009-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -39,7 +39,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -47,7 +47,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLACSource>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLACSource>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -193,7 +193,7 @@ STDMETHODIMP CFLACSource::get_Copyright(BSTR* pbstrCopyright)
CFLACStream::CFLACStream(const WCHAR* wfn, CSource* pParent, HRESULT* phr)
: CBaseStream(NAME("CFLACStream"), pParent, phr)
, m_bIsEOF(false)
- , m_pDecoder(NULL)
+ , m_pDecoder(nullptr)
{
CAutoLock cAutoLock(&m_cSharedState);
CString fn(wfn);
@@ -248,7 +248,7 @@ CFLACStream::~CFLACStream()
{
if (m_pDecoder) {
FLAC__stream_decoder_delete(_DECODER_);
- m_pDecoder = NULL;
+ m_pDecoder = nullptr;
}
}
@@ -457,7 +457,7 @@ FLAC__StreamDecoderLengthStatus StreamDecoderLength(const FLAC__StreamDecoder* d
CFLACStream* pThis = static_cast<CFLACStream*>(client_data);
CFile* pFile = pThis->GetFile();
- if (pFile == NULL) {
+ if (pFile == nullptr) {
return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;
} else {
*stream_length = pFile->GetLength();
diff --git a/src/filters/source/FLICSource/FLICSource.cpp b/src/filters/source/FLICSource/FLICSource.cpp
index e22a4794e..84d8ba9b8 100644
--- a/src/filters/source/FLICSource/FLICSource.cpp
+++ b/src/filters/source/FLICSource/FLICSource.cpp
@@ -30,7 +30,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -38,7 +38,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLICSource>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CFLICSource>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -411,7 +411,7 @@ HRESULT CFLICStream::FillBuffer(IMediaSample* pSample)
}
BYTE* pDataIn = m_pFrameBuffer;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (!pDataIn || FAILED(pSample->GetPointer(&pDataOut)) || !pDataOut) {
return S_FALSE;
}
diff --git a/src/filters/source/ShoutcastSource/ShoutcastSource.cpp b/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
index cb643cd69..322667c6b 100644
--- a/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
+++ b/src/filters/source/ShoutcastSource/ShoutcastSource.cpp
@@ -84,7 +84,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -92,7 +92,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CShoutcastSource>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CShoutcastSource>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -117,13 +117,13 @@ public:
return FALSE;
}
/*
- if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
+ if (!AfxWinInit(::GetModuleHandle(nullptr), nullptr, ::GetCommandLine(), 0))
{
AfxMessageBox(_T("AfxWinInit failed!"));
return FALSE;
}
*/
- if (!AfxSocketInit(NULL)) {
+ if (!AfxSocketInit(nullptr)) {
AfxMessageBox(_T("AfxSocketInit failed!"));
return FALSE;
}
@@ -260,8 +260,8 @@ STDMETHODIMP CShoutcastSource::QueryFilterInfo(FILTER_INFO* pInfo)
CShoutcastStream::CShoutcastStream(const WCHAR* wfn, CShoutcastSource* pParent, HRESULT* phr)
: CSourceStream(NAME("ShoutcastStream"), phr, pParent, L"Output")
, m_fBuffering(false)
- , m_hSocketThread(NULL)
- , fExitThread(NULL)
+ , m_hSocketThread(nullptr)
+ , fExitThread(nullptr)
{
ASSERT(phr);
@@ -352,7 +352,7 @@ HRESULT CShoutcastStream::DecideBufferSize(IMemAllocator* pAlloc, ALLOCATOR_PROP
HRESULT CShoutcastStream::FillBuffer(IMediaSample* pSample)
{
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (FAILED(pSample->GetPointer(&pData)) || !pData) {
return S_FALSE;
}
diff --git a/src/filters/source/SubtitleSource/SubtitleSource.cpp b/src/filters/source/SubtitleSource/SubtitleSource.cpp
index debac2187..e034032d8 100644
--- a/src/filters/source/SubtitleSource/SubtitleSource.cpp
+++ b/src/filters/source/SubtitleSource/SubtitleSource.cpp
@@ -41,7 +41,7 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudOpPin[] = {
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut},
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -55,13 +55,13 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSubtitleSourceASCII>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CSubtitleSourceUTF8>, NULL, &sudFilter[1]},
- {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CSubtitleSourceSSA>, NULL, &sudFilter[2]},
- {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CSubtitleSourceASS>, NULL, &sudFilter[3]},
- // {sudFilter[4].strName, sudFilter[4].clsID, CreateInstance<CSubtitleSourceUSF>, NULL, &sudFilter[4]},
- {sudFilter[5].strName, sudFilter[5].clsID, CreateInstance<CSubtitleSourcePreview>, NULL, &sudFilter[5]},
- {sudFilter[6].strName, sudFilter[6].clsID, CreateInstance<CSubtitleSourceARGB>, NULL, &sudFilter[6]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSubtitleSourceASCII>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CSubtitleSourceUTF8>, nullptr, &sudFilter[1]},
+ {sudFilter[2].strName, sudFilter[2].clsID, CreateInstance<CSubtitleSourceSSA>, nullptr, &sudFilter[2]},
+ {sudFilter[3].strName, sudFilter[3].clsID, CreateInstance<CSubtitleSourceASS>, nullptr, &sudFilter[3]},
+ // {sudFilter[4].strName, sudFilter[4].clsID, CreateInstance<CSubtitleSourceUSF>, nullptr, &sudFilter[4]},
+ {sudFilter[5].strName, sudFilter[5].clsID, CreateInstance<CSubtitleSourcePreview>, nullptr, &sudFilter[5]},
+ {sudFilter[6].strName, sudFilter[6].clsID, CreateInstance<CSubtitleSourceARGB>, nullptr, &sudFilter[6]},
};
int g_cTemplates = _countof(g_Templates);
@@ -231,7 +231,7 @@ CSubtitleStream::CSubtitleStream(const WCHAR* wfn, CSubtitleSource* pParent, HRE
, CSourceSeeking(NAME("SubtitleStream"), (IPin*)this, phr, &m_cSharedState)
, m_bDiscontinuity(FALSE), m_bFlushing(FALSE)
, m_nPosition(0)
- , m_rts(NULL)
+ , m_rts(nullptr)
{
CAutoLock cAutoLock(&m_cSharedState);
@@ -418,7 +418,7 @@ HRESULT CSubtitleStream::FillBuffer(IMediaSample* pSample)
{
CAutoLock cAutoLockShared(&m_cSharedState);
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
if (FAILED(pSample->GetPointer(&pData)) || !pData) {
return S_FALSE;
}
diff --git a/src/filters/switcher/AudioSwitcher/Audio.cpp b/src/filters/switcher/AudioSwitcher/Audio.cpp
index b700db922..144c834e2 100644
--- a/src/filters/switcher/AudioSwitcher/Audio.cpp
+++ b/src/filters/switcher/AudioSwitcher/Audio.cpp
@@ -196,7 +196,7 @@ AudioStreamResampler::AudioStreamResampler(int bps, long orig_rate, long new_rat
samp_frac = MulDiv(orig_rate, 0x80000, new_rate);
holdover = 0;
- filter_bank = NULL;
+ filter_bank = nullptr;
filter_width = 1;
accum = 0;
diff --git a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
index dd9929690..93cef40c7 100644
--- a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
+++ b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp
@@ -49,8 +49,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -58,7 +58,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAudioSwitcherFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAudioSwitcherFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -264,8 +264,8 @@ HRESULT CAudioSwitcherFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
return __super::Transform(pIn, pOut);
}
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
HRESULT hr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
@@ -587,7 +587,7 @@ STDMETHODIMP CAudioSwitcherFilter::SetSpeakerConfig(bool fCustomChannelMapping,
CStreamSwitcherInputPin* pInput = GetInputPin();
- SelectInput(NULL);
+ SelectInput(nullptr);
m_fCustomChannelMapping = fCustomChannelMapping;
memcpy(m_pSpeakerToChannelMap, pSpeakerToChannelMap, sizeof(m_pSpeakerToChannelMap));
diff --git a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
index 2939f4146..678d9a54a 100644
--- a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
+++ b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp
@@ -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.
*
@@ -43,7 +43,7 @@ CStreamSwitcherPassThru::CStreamSwitcherPassThru(LPUNKNOWN pUnk, HRESULT* phr, C
STDMETHODIMP CStreamSwitcherPassThru::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
CheckPointer(ppv, E_POINTER);
- *ppv = NULL;
+ *ppv = nullptr;
return
QI(IMediaSeeking)
@@ -53,7 +53,7 @@ STDMETHODIMP CStreamSwitcherPassThru::NonDelegatingQueryInterface(REFIID riid, v
template<class T>
HRESULT GetPeer(CStreamSwitcherFilter* pFilter, T** ppT)
{
- *ppT = NULL;
+ *ppT = nullptr;
CBasePin* pPin = pFilter->GetInputPin();
if (!pPin) {
@@ -278,7 +278,7 @@ STDMETHODIMP CStreamSwitcherPassThru::CanSeekBackward(LONG* pCanSeekBackward)
//
CStreamSwitcherAllocator::CStreamSwitcherAllocator(CStreamSwitcherInputPin* pPin, HRESULT* phr)
- : CMemAllocator(NAME("CStreamSwitcherAllocator"), NULL, phr)
+ : CMemAllocator(NAME("CStreamSwitcherAllocator"), nullptr, phr)
, m_pPin(pPin)
, m_fMediaTypeChanged(false)
{
@@ -383,7 +383,7 @@ CStreamSwitcherInputPin::CStreamSwitcherInputPin(CStreamSwitcherFilter* pFilter,
, m_bUsingOwnAllocator(FALSE)
, m_evBlock(TRUE)
, m_fCanBlock(false)
- , m_hNotifyEvent(NULL)
+ , m_hNotifyEvent(nullptr)
{
m_bCanReconnectWhenActive = TRUE;
}
@@ -484,8 +484,8 @@ HRESULT CStreamSwitcherInputPin::InitializeOutputSample(IMediaSample* pInSample,
}
HRESULT hr = pOut->GetDeliveryBuffer(&pOutSample
- , m_SampleProps.dwSampleFlags & AM_SAMPLE_TIMEVALID ? &m_SampleProps.tStart : NULL
- , m_SampleProps.dwSampleFlags & AM_SAMPLE_STOPVALID ? &m_SampleProps.tStop : NULL
+ , m_SampleProps.dwSampleFlags & AM_SAMPLE_TIMEVALID ? &m_SampleProps.tStart : nullptr
+ , m_SampleProps.dwSampleFlags & AM_SAMPLE_STOPVALID ? &m_SampleProps.tStop : nullptr
, dwFlags);
if (FAILED(hr)) {
@@ -590,7 +590,7 @@ HRESULT CStreamSwitcherInputPin::CompleteConnect(IPin* pReceivePin)
fForkedSomewhere = fForkedSomewhere || nIn > 1 || nOut > 1;
if (CComQIPtr<IFileSourceFilter> pFSF = pBF) {
- WCHAR* pszName = NULL;
+ WCHAR* pszName = nullptr;
AM_MEDIA_TYPE mt;
if (SUCCEEDED(pFSF->GetCurFile(&pszName, &mt)) && pszName) {
fileName = pszName;
@@ -633,7 +633,7 @@ HRESULT CStreamSwitcherInputPin::CompleteConnect(IPin* pReceivePin)
m_fCanBlock = true;
}
- m_hNotifyEvent = NULL;
+ m_hNotifyEvent = nullptr;
return S_OK;
}
@@ -687,7 +687,7 @@ STDMETHODIMP CStreamSwitcherInputPin::GetAllocator(IMemAllocator** ppAllocator)
{
CheckPointer(ppAllocator, E_POINTER);
- if (m_pAllocator == NULL) {
+ if (m_pAllocator == nullptr) {
(m_pAllocator = &m_Allocator)->AddRef();
}
@@ -760,7 +760,7 @@ STDMETHODIMP CStreamSwitcherInputPin::EndOfStream()
}
if (m_hNotifyEvent) {
- SetEvent(m_hNotifyEvent), m_hNotifyEvent = NULL;
+ SetEvent(m_hNotifyEvent), m_hNotifyEvent = nullptr;
return S_OK;
}
@@ -771,10 +771,10 @@ STDMETHODIMP CStreamSwitcherInputPin::EndOfStream()
STDMETHODIMP CStreamSwitcherInputPin::Receive(IMediaSample* pSample)
{
- AM_MEDIA_TYPE* pmt = NULL;
+ AM_MEDIA_TYPE* pmt = nullptr;
if (SUCCEEDED(pSample->GetMediaType(&pmt)) && pmt) {
const CMediaType mt(*pmt);
- DeleteMediaType(pmt), pmt = NULL;
+ DeleteMediaType(pmt), pmt = nullptr;
SetMediaType(&mt);
}
@@ -841,7 +841,7 @@ STDMETHODIMP CStreamSwitcherInputPin::Receive(IMediaSample* pSample)
/*
if (CComQIPtr<IPinConnection> pPC = pOut->CurrentPinConnection())
{
- HANDLE hEOS = CreateEvent(NULL, FALSE, FALSE, NULL);
+ HANDLE hEOS = CreateEvent(nullptr, FALSE, FALSE, nullptr);
hr = pPC->NotifyEndOfStream(hEOS);
hr = pOut->DeliverEndOfStream();
WaitForSingleObject(hEOS, 3000);
@@ -874,10 +874,10 @@ STDMETHODIMP CStreamSwitcherInputPin::Receive(IMediaSample* pSample)
return E_FAIL;
}
- pmt = NULL;
+ pmt = nullptr;
if (SUCCEEDED(pOutSample->GetMediaType(&pmt)) && pmt) {
const CMediaType mt(*pmt);
- DeleteMediaType(pmt), pmt = NULL;
+ DeleteMediaType(pmt), pmt = nullptr;
// TODO
ASSERT(0);
}
@@ -905,7 +905,7 @@ STDMETHODIMP CStreamSwitcherInputPin::Receive(IMediaSample* pSample)
*/
} else if (S_FALSE == hr) {
hr = S_OK;
- pOutSample = NULL;
+ pOutSample = nullptr;
m_bSampleSkipped = TRUE;
if (!m_bQualityChanged) {
@@ -949,10 +949,10 @@ STDMETHODIMP CStreamSwitcherOutputPin::NonDelegatingQueryInterface(REFIID riid,
{
CheckPointer(ppv, E_POINTER);
ValidateReadWritePtr(ppv, sizeof(PVOID));
- *ppv = NULL;
+ *ppv = nullptr;
if (riid == IID_IMediaPosition || riid == IID_IMediaSeeking) {
- if (m_pStreamSwitcherPassThru == NULL) {
+ if (m_pStreamSwitcherPassThru == nullptr) {
HRESULT hr = S_OK;
m_pStreamSwitcherPassThru = (IUnknown*)(INonDelegatingUnknown*)
DEBUG_NEW CStreamSwitcherPassThru(GetOwner(), &hr, static_cast<CStreamSwitcherFilter*>(m_pFilter));
@@ -1049,7 +1049,7 @@ HRESULT CStreamSwitcherOutputPin::CheckConnect(IPin* pPin)
HRESULT CStreamSwitcherOutputPin::BreakConnect()
{
- m_pPinConnection = NULL;
+ m_pPinConnection = nullptr;
return __super::BreakConnect();
}
@@ -1080,8 +1080,8 @@ HRESULT CStreamSwitcherOutputPin::GetMediaType(int iPosition, CMediaType* pmt)
return VFW_S_NO_MORE_ITEMS;
}
- AM_MEDIA_TYPE* tmp = NULL;
- if (S_OK != pEM->Next(1, &tmp, NULL) || !tmp) {
+ AM_MEDIA_TYPE* tmp = nullptr;
+ if (S_OK != pEM->Next(1, &tmp, nullptr) || !tmp) {
return VFW_S_NO_MORE_ITEMS;
}
@@ -1129,7 +1129,7 @@ STDMETHODIMP CStreamSwitcherOutputPin::Render(IPin* ppinOut, IGraphBuilder* pGra
return E_FAIL;
}
- if (FAILED(pGraph->ConnectDirect(ppinOut, GetFirstDisconnectedPin(pBF, PINDIR_INPUT), NULL))) {
+ if (FAILED(pGraph->ConnectDirect(ppinOut, GetFirstDisconnectedPin(pBF, PINDIR_INPUT), nullptr))) {
pGraph->RemoveFilter(pBF);
return E_FAIL;
}
@@ -1193,10 +1193,10 @@ CStreamSwitcherFilter::~CStreamSwitcherFilter()
delete m_pInputs.GetNext(pos);
}
m_pInputs.RemoveAll();
- m_pInput = NULL;
+ m_pInput = nullptr;
delete m_pOutput;
- m_pOutput = NULL;
+ m_pOutput = nullptr;
}
STDMETHODIMP CStreamSwitcherFilter::NonDelegatingQueryInterface(REFIID riid, void** ppv)
@@ -1220,7 +1220,7 @@ CBasePin* CStreamSwitcherFilter::GetPin(int n)
CAutoLock cAutoLock(&m_csPins);
if (n < 0 || n >= GetPinCount()) {
- return NULL;
+ return nullptr;
} else if (n == 0) {
return m_pOutput;
} else {
@@ -1259,7 +1259,7 @@ CStreamSwitcherInputPin* CStreamSwitcherFilter::GetConnectedInputPin(int n)
}
}
- return NULL;
+ return nullptr;
}
CStreamSwitcherInputPin* CStreamSwitcherFilter::GetInputPin()
@@ -1307,14 +1307,14 @@ HRESULT CStreamSwitcherFilter::CompleteConnect(PIN_DIRECTION dir, CBasePin* pPin
void CStreamSwitcherFilter::SelectInput(CStreamSwitcherInputPin* pInput)
{
// make sure no input thinks it is active
- m_pInput = NULL;
+ m_pInput = nullptr;
// release blocked GetBuffer in our own allocator & block all Receive
POSITION pos = m_pInputs.GetHeadPosition();
while (pos) {
CStreamSwitcherInputPin* pPin = m_pInputs.GetNext(pos);
pPin->Block(false);
- // a few Receive calls can arrive here, but since m_pInput == NULL neighter of them gets delivered
+ // a few Receive calls can arrive here, but since m_pInput == nullptr neighter of them gets delivered
pPin->Block(true);
}
@@ -1339,8 +1339,8 @@ void CStreamSwitcherFilter::SelectInput(CStreamSwitcherInputPin* pInput)
HRESULT CStreamSwitcherFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
{
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
HRESULT hr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
@@ -1436,11 +1436,11 @@ STDMETHODIMP CStreamSwitcherFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWOR
}
if (ppObject) {
- *ppObject = NULL;
+ *ppObject = nullptr;
}
if (ppUnk) {
- *ppUnk = NULL;
+ *ppUnk = nullptr;
}
return S_OK;
diff --git a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
index 2692758a7..b3424e517 100644
--- a/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
+++ b/src/filters/transform/AVI2AC3Filter/AVI2AC3Filter.cpp
@@ -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.
*
@@ -41,8 +41,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -50,7 +50,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAVI2AC3Filter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CAVI2AC3Filter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -91,7 +91,7 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl
{
HRESULT hr;
- BYTE* pIn = NULL;
+ BYTE* pIn = nullptr;
if (FAILED(hr = pSample->GetPointer(&pIn))) {
return hr;
}
@@ -102,7 +102,7 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl
return S_FALSE;
}
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
if (FAILED(hr = pOutSample->GetPointer(&pOut))) {
return hr;
}
@@ -154,11 +154,11 @@ HRESULT CAVI2AC3Filter::Transform(IMediaSample* pSample, IMediaSample* pOutSampl
fDiscontinuity = false;
} else {
- pOutSample->SetTime(NULL, NULL);
+ pOutSample->SetTime(nullptr, nullptr);
pOutSample->SetDiscontinuity(FALSE);
}
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
if (FAILED(hr = pOutSample->GetPointer(&pOut))) {
return hr;
}
diff --git a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
index e54beb624..ee87da93b 100644
--- a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
+++ b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
@@ -54,7 +54,7 @@ CBaseVideoFilter::CBaseVideoFilter(TCHAR* pName, LPUNKNOWN lpunk, HRESULT* phr,
*phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
@@ -90,7 +90,7 @@ CBasePin* CBaseVideoFilter::GetPin(int n)
case 1:
return m_pOutput;
}
- return NULL;
+ return nullptr;
}
HRESULT CBaseVideoFilter::Receive(IMediaSample* pIn)
@@ -133,7 +133,7 @@ HRESULT CBaseVideoFilter::GetDeliveryBuffer(int w, int h, IMediaSample** ppOut)
return hr;
}
- if (FAILED(hr = m_pOutput->GetDeliveryBuffer(ppOut, NULL, NULL, 0))) {
+ if (FAILED(hr = m_pOutput->GetDeliveryBuffer(ppOut, nullptr, nullptr, 0))) {
return hr;
}
@@ -188,7 +188,7 @@ HRESULT CBaseVideoFilter::ReconnectOutput(int w, int h, bool bSendSample, int re
return E_FAIL;
}
- BITMAPINFOHEADER* bmi = NULL;
+ BITMAPINFOHEADER* bmi = nullptr;
if (mt.formattype == FORMAT_VideoInfo) {
VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.Format();
@@ -227,7 +227,7 @@ HRESULT CBaseVideoFilter::ReconnectOutput(int w, int h, bool bSendSample, int re
CComPtr<IMediaSample> pOut;
if (SUCCEEDED(m_pOutput->GetConnected()->ReceiveConnection(m_pOutput, &mt))) {
if (bSendSample) {
- if (SUCCEEDED(m_pOutput->GetDeliveryBuffer(&pOut, NULL, NULL, 0))) {
+ if (SUCCEEDED(m_pOutput->GetDeliveryBuffer(&pOut, nullptr, nullptr, 0))) {
AM_MEDIA_TYPE* pmt;
if (SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
CMediaType mt2 = *pmt;
@@ -634,7 +634,7 @@ HRESULT CBaseVideoFilter::SetMediaType(PIN_DIRECTION dir, const CMediaType* pmt)
//
CBaseVideoInputAllocator::CBaseVideoInputAllocator(HRESULT* phr)
- : CMemAllocator(NAME("CBaseVideoInputAllocator"), NULL, phr)
+ : CMemAllocator(NAME("CBaseVideoInputAllocator"), nullptr, phr)
{
if (phr) {
*phr = S_OK;
@@ -668,7 +668,7 @@ STDMETHODIMP CBaseVideoInputAllocator::GetBuffer(IMediaSample** ppBuffer, REFERE
CBaseVideoInputPin::CBaseVideoInputPin(TCHAR* pObjectName, CBaseVideoFilter* pFilter, HRESULT* phr, LPCWSTR pName)
: CTransformInputPin(pObjectName, pFilter, phr, pName)
- , m_pAllocator(NULL)
+ , m_pAllocator(nullptr)
{
}
@@ -681,7 +681,7 @@ STDMETHODIMP CBaseVideoInputPin::GetAllocator(IMemAllocator** ppAllocator)
{
CheckPointer(ppAllocator, E_POINTER);
- if (m_pAllocator == NULL) {
+ if (m_pAllocator == nullptr) {
HRESULT hr = S_OK;
m_pAllocator = DEBUG_NEW CBaseVideoInputAllocator(&hr);
m_pAllocator->AddRef();
diff --git a/src/filters/transform/BufferFilter/BufferFilter.cpp b/src/filters/transform/BufferFilter/BufferFilter.cpp
index 5b195a6ca..f40a4bc39 100644
--- a/src/filters/transform/BufferFilter/BufferFilter.cpp
+++ b/src/filters/transform/BufferFilter/BufferFilter.cpp
@@ -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.
*
@@ -34,8 +34,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -43,7 +43,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CBufferFilter>, nullptr, &sudFilter[0]}
};
int g_cTemplates = _countof(g_Templates);
@@ -88,7 +88,7 @@ CBufferFilter::CBufferFilter(LPUNKNOWN lpunk, HRESULT* phr)
hr = E_OUTOFMEMORY;
}
if (FAILED(hr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
break;
}
} while (false);
@@ -157,7 +157,7 @@ HRESULT CBufferFilter::Receive(IMediaSample* pSample)
ASSERT(pSample);
IMediaSample* pOutSample;
- ASSERT(m_pOutput != NULL);
+ ASSERT(m_pOutput != nullptr);
// Set up the output sample
hr = InitializeOutputSample(pSample, &pOutSample);
@@ -215,8 +215,8 @@ HRESULT CBufferFilter::Receive(IMediaSample* pSample)
HRESULT CBufferFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
{
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
pIn->GetPointer(&pDataIn);
pOut->GetPointer(&pDataOut);
diff --git a/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp b/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp
index b2e1044a9..c9f1cc143 100644
--- a/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp
+++ b/src/filters/transform/DeCSSFilter/DeCSSFilter.cpp
@@ -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.
*
@@ -37,8 +37,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -46,7 +46,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDeCSSFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDeCSSFilter>, nullptr, &sudFilter[0]},
};
int g_cTemplates = _countof(g_Templates);
@@ -119,7 +119,7 @@ CDeCSSFilter::CDeCSSFilter(LPUNKNOWN lpunk, HRESULT* phr)
*phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
}
@@ -140,8 +140,8 @@ HRESULT CDeCSSFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
DeleteMediaType(pmt);
}
- BYTE* pDataIn = NULL;
- BYTE* pDataOut = NULL;
+ BYTE* pDataIn = nullptr;
+ BYTE* pDataOut = nullptr;
pIn->GetPointer(&pDataIn);
pOut->GetPointer(&pDataOut);
@@ -149,7 +149,7 @@ HRESULT CDeCSSFilter::Transform(IMediaSample* pIn, IMediaSample* pOut)
long len = pIn->GetActualDataLength();
long size = pOut->GetSize();
- if (len == 0 || pDataIn == NULL) { // format changes do not carry any data
+ if (len == 0 || pDataIn == nullptr) { // format changes do not carry any data
pOut->SetActualDataLength(0);
return S_OK;
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
index 23b07dcba..3b343921b 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp
@@ -117,7 +117,7 @@ void CDXVADecoder::Flush()
m_pPictureStore[i].bRefPicture = false;
m_pPictureStore[i].bInUse = false;
m_pPictureStore[i].bDisplayed = false;
- m_pPictureStore[i].pSample = NULL;
+ m_pPictureStore[i].pSample = nullptr;
m_pPictureStore[i].nCodecSpecific = -1;
m_pPictureStore[i].dwDisplayCount = 0;
}
@@ -126,7 +126,7 @@ void CDXVADecoder::Flush()
m_bFlushed = true;
m_nFieldSurface = -1;
m_dwDisplayCount = 1;
- m_pFieldSample = NULL;
+ m_pFieldSample = nullptr;
}
HRESULT CDXVADecoder::ConfigureDXVA1()
@@ -142,7 +142,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1()
ConfigRequested.bConfigBitstreamRaw = 2;
writeDXVA_QueryOrReplyFunc(&ConfigRequested.dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- hr = m_pAMVideoAccelerator->Execute(ConfigRequested.dwFunction, &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(ConfigRequested.dwFunction, &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), 0, nullptr);
// Copy to DXVA2 structure (simplify code based on accelerator config)
m_DXVA2Config.guidConfigBitstreamEncryption = m_DXVA1Config.guidConfigBitstreamEncryption;
@@ -163,7 +163,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1()
if (SUCCEEDED(hr)) {
writeDXVA_QueryOrReplyFunc(&m_DXVA1Config.dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- hr = m_pAMVideoAccelerator->Execute(m_DXVA1Config.dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(m_DXVA1Config.dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), &ConfigRequested, sizeof(DXVA_ConfigPictureDecode), 0, nullptr);
// TODO : check config!
//ASSERT (ConfigRequested.bConfigBitstreamRaw == 2);
@@ -181,7 +181,7 @@ HRESULT CDXVADecoder::ConfigureDXVA1()
CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IAMVideoAccelerator* pAMVideoAccelerator, const GUID* guidDecoder, int nPicEntryNumber)
{
- CDXVADecoder* pDecoder = NULL;
+ CDXVADecoder* pDecoder = nullptr;
if ((*guidDecoder == DXVA2_ModeH264_E) || (*guidDecoder == DXVA2_ModeH264_F) || (*guidDecoder == DXVA_Intel_H264_ClearVideo)) {
pDecoder = DEBUG_NEW CDXVADecoderH264(pFilter, pAMVideoAccelerator, H264_VLD, nPicEntryNumber);
@@ -198,7 +198,7 @@ CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IAMVideoA
CDXVADecoder* CDXVADecoder::CreateDecoder(CMPCVideoDecFilter* pFilter, IDirectXVideoDecoder* pDirectXVideoDec, const GUID* guidDecoder, int nPicEntryNumber, DXVA2_ConfigPictureDecode* pDXVA2Config)
{
- CDXVADecoder* pDecoder = NULL;
+ CDXVADecoder* pDecoder = nullptr;
if ((*guidDecoder == DXVA2_ModeH264_E) || (*guidDecoder == DXVA2_ModeH264_F) || (*guidDecoder == DXVA_Intel_H264_ClearVideo)) {
pDecoder = DEBUG_NEW CDXVADecoderH264(pFilter, pDirectXVideoDec, H264_VLD, nPicEntryNumber, pDXVA2Config);
@@ -299,7 +299,7 @@ HRESULT CDXVADecoder::GetDeliveryBuffer(REFERENCE_TIME rtStart, REFERENCE_TIME r
if (SUCCEEDED(hr)) {
pNewSample->SetTime(&rtStart, &rtStop);
- pNewSample->SetMediaTime(NULL, NULL);
+ pNewSample->SetMediaTime(nullptr, nullptr);
*ppSampleToDeliver = pNewSample.Detach();
}
return hr;
@@ -315,7 +315,7 @@ HRESULT CDXVADecoder::Execute()
HRESULT hr2;
//writeDXVA_QueryOrReplyFunc(&dwFunction, DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY, DXVA_PICTURE_DECODING_FUNCTION);
- //hr = m_pAMVideoAccelerator->Execute (dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), NULL, 0, m_dwNumBuffersInfo, m_DXVA1BufferInfo);
+ //hr = m_pAMVideoAccelerator->Execute (dwFunction, &m_DXVA1Config, sizeof(DXVA_ConfigPictureDecode), nullptr, 0, m_dwNumBuffersInfo, m_DXVA1BufferInfo);
DWORD dwResult;
dwFunction = 0x01000000;
@@ -356,7 +356,7 @@ HRESULT CDXVADecoder::QueryStatus(PVOID LPDXVAStatus, UINT nSize)
switch (m_nEngine) {
case ENGINE_DXVA1:
- hr = m_pAMVideoAccelerator->Execute(dwFunction, NULL, 0, LPDXVAStatus, nSize, 0, NULL);
+ hr = m_pAMVideoAccelerator->Execute(dwFunction, nullptr, 0, LPDXVAStatus, nSize, 0, nullptr);
break;
case ENGINE_DXVA2:
@@ -420,7 +420,7 @@ HRESULT CDXVADecoder::BeginFrame(int nSurfaceIndex, IMediaSample* pSampleToDeliv
BeginFrameInfo.dwSizeInputData = sizeof(nSurfaceIndex);
BeginFrameInfo.pInputData = &nSurfaceIndex;
BeginFrameInfo.dwSizeOutputData = 0;
- BeginFrameInfo.pOutputData = NULL;
+ BeginFrameInfo.pOutputData = nullptr;
DO_DXVA_PENDING_LOOP(m_pAMVideoAccelerator->BeginFrame(&BeginFrameInfo));
@@ -437,7 +437,7 @@ HRESULT CDXVADecoder::BeginFrame(int nSurfaceIndex, IMediaSample* pSampleToDeliv
if (pSampleService) {
hr = pSampleService->GetService(MR_BUFFER_SERVICE, __uuidof(IDirect3DSurface9), (void**) &pDecoderRenderTarget);
if (SUCCEEDED(hr)) {
- DO_DXVA_PENDING_LOOP(m_pDirectXVideoDec->BeginFrame(pDecoderRenderTarget, NULL));
+ DO_DXVA_PENDING_LOOP(m_pDirectXVideoDec->BeginFrame(pDecoderRenderTarget, nullptr));
}
}
}
@@ -473,7 +473,7 @@ HRESULT CDXVADecoder::EndFrame(int nSurfaceIndex)
break;
case ENGINE_DXVA2:
- hr = m_pDirectXVideoDec->EndFrame(NULL);
+ hr = m_pDirectXVideoDec->EndFrame(nullptr);
break;
default:
ASSERT(FALSE);
@@ -499,9 +499,9 @@ bool CDXVADecoder::AddToStore(int nSurfaceIndex, IMediaSample* pSample, bool bRe
} else {
//TRACE(_T("Add Stor: [%10I64d - %10I64d], Ind = %d, Codec=%d\n"), rtStart, rtStop, nSurfaceIndex, nCodecSpecific);
/*
- ASSERT(m_pPictureStore[nSurfaceIndex].pSample == NULL);
+ ASSERT(m_pPictureStore[nSurfaceIndex].pSample == nullptr);
ASSERT(!m_pPictureStore[nSurfaceIndex].bInUse);
- ASSERT((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == NULL));
+ ASSERT((nSurfaceIndex < m_nPicEntryNumber) && (m_pPictureStore[nSurfaceIndex].pSample == nullptr));
*/
m_pPictureStore[nSurfaceIndex].bRefPicture = bRefPicture;
@@ -707,7 +707,7 @@ void CDXVADecoder::FreePictureSlot(int nSurfaceIndex)
m_pPictureStore[nSurfaceIndex].dwDisplayCount = m_dwDisplayCount++;
m_pPictureStore[nSurfaceIndex].bInUse = false;
m_pPictureStore[nSurfaceIndex].bDisplayed = false;
- m_pPictureStore[nSurfaceIndex].pSample = NULL;
+ m_pPictureStore[nSurfaceIndex].pSample = nullptr;
m_pPictureStore[nSurfaceIndex].nCodecSpecific = -1;
m_nWaitingPics--;
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
index 68c40d362..71ffbe82a 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -335,7 +335,7 @@ void CDXVADecoderH264::SetExtraData(BYTE* pDataIn, UINT nSize)
AVCodecContext* pAVCtx = m_pFilter->GetAVCtx();
m_nNALLength = pAVCtx->nal_length_size;
- FFH264DecodeBuffer(pAVCtx, pDataIn, nSize, NULL, NULL, NULL);
+ FFH264DecodeBuffer(pAVCtx, pDataIn, nSize, nullptr, nullptr, nullptr);
FFH264SetDxvaSliceLong(pAVCtx, m_pSliceLong);
}
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
index 6037452c2..286ba9d0c 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp
@@ -91,7 +91,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME
if (!m_PictureParams.bSecondField) {
m_rtStart = rtStart;
m_rtStop = rtStop;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
hr = GetFreeSurfaceIndex(m_nSurfaceIndex, &m_pSampleToDeliver, rtStart, rtStop);
if (FAILED(hr)) {
ASSERT(hr == VFW_E_NOT_COMMITTED); // Normal when stop playing
@@ -101,7 +101,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME
} else {
m_rtStart = rtStart;
m_rtStop = rtStop;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
hr = GetFreeSurfaceIndex(m_nSurfaceIndex, &m_pSampleToDeliver, rtStart, rtStop);
if (FAILED(hr)) {
ASSERT(hr == VFW_E_NOT_COMMITTED); // Normal when stop playing
@@ -110,7 +110,7 @@ HRESULT CDXVADecoderMpeg2::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME
}
// m_pSampleToDeliver is unused for DXVA1
- if (GetEngine() == ENGINE_DXVA2 && m_pSampleToDeliver == NULL) {
+ if (GetEngine() == ENGINE_DXVA2 && m_pSampleToDeliver == nullptr) {
return S_FALSE;
}
@@ -236,7 +236,7 @@ void CDXVADecoderMpeg2::Flush()
m_wRefPictureIndex[1] = NO_REF_FRAME;
m_nSurfaceIndex = 0;
- m_pSampleToDeliver = NULL;
+ m_pSampleToDeliver = nullptr;
m_bSecondField = false;
m_rtStart = _I64_MIN;
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
index 3e2bc0aed..a08b414b1 100644
--- a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
+++ b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -142,7 +142,7 @@ HRESULT CDXVADecoderVC1::DecodeFrame(BYTE* pDataIn, UINT nSize, REFERENCE_TIME r
// ***************
if (nFrameSize) { // Decoding Second Field
- FFVC1UpdatePictureParam(&m_PictureParams, m_pFilter->GetAVCtx(), NULL, NULL, pDataIn, nSize, NULL, TRUE, &m_bFrame_repeat_pict);
+ FFVC1UpdatePictureParam(&m_PictureParams, m_pFilter->GetAVCtx(), nullptr, nullptr, pDataIn, nSize, nullptr, TRUE, &m_bFrame_repeat_pict);
CHECK_HR_TRACE(BeginFrame(nSurfaceIndex, pSampleToDeliver));
@@ -250,7 +250,7 @@ BYTE* CDXVADecoderVC1::FindNextStartCode(BYTE* pBuffer, UINT nSize, UINT& nPacke
ASSERT(FALSE); // Should never happen!
- return NULL;
+ return nullptr;
}
void CDXVADecoderVC1::CopyBitstream(BYTE* pDXVABuffer, BYTE* pBuffer, UINT& nSize)
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
index a5cd1877e..ee09201da 100644
--- a/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
+++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp
@@ -154,7 +154,7 @@ bool CheckPCID(WORD pcid, const WORD* pPCIDs, size_t len)
inline MpegEncContext* GetMpegEncContext(struct AVCodecContext* pAVCtx)
{
Mpeg1Context* s1;
- MpegEncContext* s = NULL;
+ MpegEncContext* s = nullptr;
switch (pAVCtx->codec_id) {
case AV_CODEC_ID_VC1:
@@ -177,11 +177,11 @@ int FFH264DecodeBuffer(struct AVCodecContext* pAVCtx,
REFERENCE_TIME* pOutrtStart)
{
int result = -1;
- if (pBuffer != NULL) {
+ if (pBuffer != nullptr) {
H264Context* h = (H264Context*) pAVCtx->priv_data;
result = av_h264_decode_frame(pAVCtx, pOutPOC, pOutrtStart, pBuffer, nSize);
- if (result != -1 && h->s.current_picture_ptr != NULL && pFramePOC) {
+ if (result != -1 && h->s.current_picture_ptr != nullptr && pFramePOC) {
*pFramePOC = h->s.current_picture_ptr->poc;
}
}
@@ -228,14 +228,14 @@ int FFH264CheckCompatibility(int nWidth,
int profile_higher_than_high = 0;
int max_ref_frames_dpb41 = min(11, 8388608 / (nWidth * nHeight));
- if (pBuffer != NULL) {
- av_h264_decode_frame(pAVCtx, NULL, NULL, pBuffer, nSize);
+ if (pBuffer != nullptr) {
+ av_h264_decode_frame(pAVCtx, nullptr, nullptr, pBuffer, nSize);
}
cur_sps = pContext->sps_buffers[0];
cur_pps = pContext->pps_buffers[0];
- if (cur_sps != NULL) {
+ if (cur_sps != nullptr) {
int max_ref_frames = 0;
if (cur_sps->bit_depth_luma > 8 || cur_sps->chroma_format_idc > 1) {
@@ -470,14 +470,14 @@ void FFH264UpdateRefFramesList(DXVA_PicParams_H264* pDXVAPicParams, struct AVCod
AssociatedFlag = pic->long_ref != 0;
} else {
// Long list reference frames
- pic = NULL;
+ pic = nullptr;
while (!pic && j < h->short_ref_count + 16) {
pic = h->long_ref[j++ - h->short_ref_count];
}
AssociatedFlag = 1;
}
- if (pic != NULL) {
+ if (pic != nullptr) {
pDXVAPicParams->FrameNumList[i] = pic->long_ref ? pic->pic_id : pic->frame_num;
pDXVAPicParams->FieldOrderCntList[i][0] = 0;
pDXVAPicParams->FieldOrderCntList[i][1] = 0;
@@ -833,7 +833,7 @@ unsigned long FFGetMBNumber(struct AVCodecContext* pAVCtx)
{
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->mb_num : 0;
+ return (s != nullptr) ? s->mb_num : 0;
}
int FFIsSkipped(struct AVCodecContext* pAVCtx)
@@ -888,14 +888,14 @@ int FFGetCodedPicture(struct AVCodecContext* pAVCtx)
{
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->current_picture.f.coded_picture_number : 0;
+ return (s != nullptr) ? s->current_picture.f.coded_picture_number : 0;
}
BOOL FFGetAlternateScan(struct AVCodecContext* pAVCtx)
{
MpegEncContext* s = GetMpegEncContext(pAVCtx);
- return (s != NULL) ? s->alternate_scan : 0;
+ return (s != nullptr) ? s->alternate_scan : 0;
}
BOOL DXVACheckFramesize(int width, int height, DWORD nPCIVendor, DWORD nPCIDevice)
diff --git a/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp b/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp
index b10403b6c..4528621d3 100644
--- a/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp
+++ b/src/filters/transform/MPCVideoDec/MPCFfmpegDec.cpp
@@ -26,8 +26,8 @@
// Workaround: graphedit crashes when a filter exposes more than 115 input MediaTypes!
const AMOVIESETUP_PIN sudpPinsVideoDec[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, CMPCVideoDecFilter::sudPinTypesInCount > 115 ? 115 : CMPCVideoDecFilter::sudPinTypesInCount, CMPCVideoDecFilter::sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, CMPCVideoDecFilter::sudPinTypesOutCount, CMPCVideoDecFilter::sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, CMPCVideoDecFilter::sudPinTypesInCount > 115 ? 115 : CMPCVideoDecFilter::sudPinTypesInCount, CMPCVideoDecFilter::sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, CMPCVideoDecFilter::sudPinTypesOutCount, CMPCVideoDecFilter::sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilters[] = {
@@ -35,7 +35,7 @@ const AMOVIESETUP_FILTER sudFilters[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilters[0].strName, &__uuidof(CMPCVideoDecFilter), CreateInstance<CMPCVideoDecFilter>, NULL, &sudFilters[0]},
+ {sudFilters[0].strName, &__uuidof(CMPCVideoDecFilter), CreateInstance<CMPCVideoDecFilter>, nullptr, &sudFilters[0]},
{L"CMPCVideoDecPropertyPage", &__uuidof(CMPCVideoDecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>>},
{L"CMPCVideoDecPropertyPage2", &__uuidof(CMPCVideoDecCodecWnd), CreateInstance<CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>>},
};
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
index 2ef06fb4b..853401ffc 100644
--- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
+++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
@@ -114,51 +114,51 @@ DXVA_PARAMS DXVA_VC1 = {
FFMPEG_CODECS ffCodecs[] = {
#if HAS_FFMPEG_VIDEO_DECODERS
// Flash video
- { &MEDIASUBTYPE_FLV1, AV_CODEC_ID_FLV1, NULL },
- { &MEDIASUBTYPE_flv1, AV_CODEC_ID_FLV1, NULL },
- { &MEDIASUBTYPE_FLV4, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_flv4, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_VP6F, AV_CODEC_ID_VP6F, NULL },
- { &MEDIASUBTYPE_vp6f, AV_CODEC_ID_VP6F, NULL },
+ { &MEDIASUBTYPE_FLV1, AV_CODEC_ID_FLV1, nullptr },
+ { &MEDIASUBTYPE_flv1, AV_CODEC_ID_FLV1, nullptr },
+ { &MEDIASUBTYPE_FLV4, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_flv4, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_VP6F, AV_CODEC_ID_VP6F, nullptr },
+ { &MEDIASUBTYPE_vp6f, AV_CODEC_ID_VP6F, nullptr },
// VP3
- { &MEDIASUBTYPE_VP30, AV_CODEC_ID_VP3, NULL },
- { &MEDIASUBTYPE_VP31, AV_CODEC_ID_VP3, NULL },
+ { &MEDIASUBTYPE_VP30, AV_CODEC_ID_VP3, nullptr },
+ { &MEDIASUBTYPE_VP31, AV_CODEC_ID_VP3, nullptr },
// VP5
- { &MEDIASUBTYPE_VP50, AV_CODEC_ID_VP5, NULL },
- { &MEDIASUBTYPE_vp50, AV_CODEC_ID_VP5, NULL },
+ { &MEDIASUBTYPE_VP50, AV_CODEC_ID_VP5, nullptr },
+ { &MEDIASUBTYPE_vp50, AV_CODEC_ID_VP5, nullptr },
// VP6
- { &MEDIASUBTYPE_VP60, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp60, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP61, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp61, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP62, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_vp62, AV_CODEC_ID_VP6, NULL },
- { &MEDIASUBTYPE_VP6A, AV_CODEC_ID_VP6A, NULL },
- { &MEDIASUBTYPE_vp6a, AV_CODEC_ID_VP6A, NULL },
+ { &MEDIASUBTYPE_VP60, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp60, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP61, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp61, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP62, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_vp62, AV_CODEC_ID_VP6, nullptr },
+ { &MEDIASUBTYPE_VP6A, AV_CODEC_ID_VP6A, nullptr },
+ { &MEDIASUBTYPE_vp6a, AV_CODEC_ID_VP6A, nullptr },
// VP8
- { &MEDIASUBTYPE_VP80, AV_CODEC_ID_VP8, NULL },
+ { &MEDIASUBTYPE_VP80, AV_CODEC_ID_VP8, nullptr },
// Xvid
- { &MEDIASUBTYPE_XVID, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_xvid, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_XVIX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_xvix, AV_CODEC_ID_MPEG4, NULL },
+ { &MEDIASUBTYPE_XVID, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_xvid, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_XVIX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_xvix, AV_CODEC_ID_MPEG4, nullptr },
// DivX
- { &MEDIASUBTYPE_DX50, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dx50, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DIVX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_divx, AV_CODEC_ID_MPEG4, NULL },
+ { &MEDIASUBTYPE_DX50, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dx50, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DIVX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_divx, AV_CODEC_ID_MPEG4, nullptr },
// WMV1/2/3
- { &MEDIASUBTYPE_WMV1, AV_CODEC_ID_WMV1, NULL },
- { &MEDIASUBTYPE_wmv1, AV_CODEC_ID_WMV1, NULL },
- { &MEDIASUBTYPE_WMV2, AV_CODEC_ID_WMV2, NULL },
- { &MEDIASUBTYPE_wmv2, AV_CODEC_ID_WMV2, NULL },
+ { &MEDIASUBTYPE_WMV1, AV_CODEC_ID_WMV1, nullptr },
+ { &MEDIASUBTYPE_wmv1, AV_CODEC_ID_WMV1, nullptr },
+ { &MEDIASUBTYPE_WMV2, AV_CODEC_ID_WMV2, nullptr },
+ { &MEDIASUBTYPE_wmv2, AV_CODEC_ID_WMV2, nullptr },
{ &MEDIASUBTYPE_WMV3, AV_CODEC_ID_WMV3, &DXVA_VC1 },
{ &MEDIASUBTYPE_wmv3, AV_CODEC_ID_WMV3, &DXVA_VC1 },
@@ -167,52 +167,52 @@ FFMPEG_CODECS ffCodecs[] = {
{ &MEDIASUBTYPE_MPG2, AV_CODEC_ID_MPEG2VIDEO, &DXVA_Mpeg2 },
// MSMPEG-4
- { &MEDIASUBTYPE_DIV3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DVX3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_dvx3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_MP43, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_mp43, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_COL1, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_col1, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV4, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div4, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV5, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div5, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV6, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_div6, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_AP41, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_ap41, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_MPG3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_mpg3, AV_CODEC_ID_MSMPEG4V3, NULL },
- { &MEDIASUBTYPE_DIV2, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_div2, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_MP42, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_mp42, AV_CODEC_ID_MSMPEG4V2, NULL },
- { &MEDIASUBTYPE_MPG4, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_mpg4, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_DIV1, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_div1, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_MP41, AV_CODEC_ID_MSMPEG4V1, NULL },
- { &MEDIASUBTYPE_mp41, AV_CODEC_ID_MSMPEG4V1, NULL },
+ { &MEDIASUBTYPE_DIV3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DVX3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_dvx3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_MP43, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_mp43, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_COL1, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_col1, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV4, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div4, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV5, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div5, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV6, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_div6, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_AP41, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_ap41, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_MPG3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_mpg3, AV_CODEC_ID_MSMPEG4V3, nullptr },
+ { &MEDIASUBTYPE_DIV2, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_div2, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_MP42, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_mp42, AV_CODEC_ID_MSMPEG4V2, nullptr },
+ { &MEDIASUBTYPE_MPG4, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_mpg4, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_DIV1, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_div1, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_MP41, AV_CODEC_ID_MSMPEG4V1, nullptr },
+ { &MEDIASUBTYPE_mp41, AV_CODEC_ID_MSMPEG4V1, nullptr },
// AMV Video
- { &MEDIASUBTYPE_AMVV, AV_CODEC_ID_AMV, NULL },
+ { &MEDIASUBTYPE_AMVV, AV_CODEC_ID_AMV, nullptr },
// MJPEG
- { &MEDIASUBTYPE_MJPG, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_QTJpeg, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_MJPA, AV_CODEC_ID_MJPEG, NULL },
- { &MEDIASUBTYPE_MJPB, AV_CODEC_ID_MJPEGB, NULL },
+ { &MEDIASUBTYPE_MJPG, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_QTJpeg, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_MJPA, AV_CODEC_ID_MJPEG, nullptr },
+ { &MEDIASUBTYPE_MJPB, AV_CODEC_ID_MJPEGB, nullptr },
// TSCC
- { &MEDIASUBTYPE_TSCC, AV_CODEC_ID_TSCC, NULL },
+ { &MEDIASUBTYPE_TSCC, AV_CODEC_ID_TSCC, nullptr },
// Indeo 3/4/5
- { &MEDIASUBTYPE_IV31, AV_CODEC_ID_INDEO3, NULL },
- { &MEDIASUBTYPE_IV32, AV_CODEC_ID_INDEO3, NULL },
- { &MEDIASUBTYPE_IV41, AV_CODEC_ID_INDEO4, NULL },
- { &MEDIASUBTYPE_IV50, AV_CODEC_ID_INDEO5, NULL },
+ { &MEDIASUBTYPE_IV31, AV_CODEC_ID_INDEO3, nullptr },
+ { &MEDIASUBTYPE_IV32, AV_CODEC_ID_INDEO3, nullptr },
+ { &MEDIASUBTYPE_IV41, AV_CODEC_ID_INDEO4, nullptr },
+ { &MEDIASUBTYPE_IV50, AV_CODEC_ID_INDEO5, nullptr },
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// H264/AVC
@@ -232,27 +232,27 @@ FFMPEG_CODECS ffCodecs[] = {
#if HAS_FFMPEG_VIDEO_DECODERS
// SVQ3
- { &MEDIASUBTYPE_SVQ3, AV_CODEC_ID_SVQ3, NULL },
+ { &MEDIASUBTYPE_SVQ3, AV_CODEC_ID_SVQ3, nullptr },
// SVQ1
- { &MEDIASUBTYPE_SVQ1, AV_CODEC_ID_SVQ1, NULL },
+ { &MEDIASUBTYPE_SVQ1, AV_CODEC_ID_SVQ1, nullptr },
// H263
- { &MEDIASUBTYPE_H263, AV_CODEC_ID_H263, NULL },
- { &MEDIASUBTYPE_h263, AV_CODEC_ID_H263, NULL },
+ { &MEDIASUBTYPE_H263, AV_CODEC_ID_H263, nullptr },
+ { &MEDIASUBTYPE_h263, AV_CODEC_ID_H263, nullptr },
- { &MEDIASUBTYPE_S263, AV_CODEC_ID_H263, NULL },
- { &MEDIASUBTYPE_s263, AV_CODEC_ID_H263, NULL },
+ { &MEDIASUBTYPE_S263, AV_CODEC_ID_H263, nullptr },
+ { &MEDIASUBTYPE_s263, AV_CODEC_ID_H263, nullptr },
// Real Video
- { &MEDIASUBTYPE_RV10, AV_CODEC_ID_RV10, NULL },
- { &MEDIASUBTYPE_RV20, AV_CODEC_ID_RV20, NULL },
- { &MEDIASUBTYPE_RV30, AV_CODEC_ID_RV30, NULL },
- { &MEDIASUBTYPE_RV40, AV_CODEC_ID_RV40, NULL },
+ { &MEDIASUBTYPE_RV10, AV_CODEC_ID_RV10, nullptr },
+ { &MEDIASUBTYPE_RV20, AV_CODEC_ID_RV20, nullptr },
+ { &MEDIASUBTYPE_RV30, AV_CODEC_ID_RV30, nullptr },
+ { &MEDIASUBTYPE_RV40, AV_CODEC_ID_RV40, nullptr },
// Theora
- { &MEDIASUBTYPE_THEORA, AV_CODEC_ID_THEORA, NULL },
- { &MEDIASUBTYPE_theora, AV_CODEC_ID_THEORA, NULL },
+ { &MEDIASUBTYPE_THEORA, AV_CODEC_ID_THEORA, nullptr },
+ { &MEDIASUBTYPE_theora, AV_CODEC_ID_THEORA, nullptr },
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
// WVC1
@@ -261,46 +261,46 @@ FFMPEG_CODECS ffCodecs[] = {
#if HAS_FFMPEG_VIDEO_DECODERS
// Other MPEG-4
- { &MEDIASUBTYPE_MP4V, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_mp4v, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_M4S2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_m4s2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_MP4S, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_mp4s, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IV1, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3iv1, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IV2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3iv2, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3IVX, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_3ivx, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_BLZ0, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_blz0, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DM4V, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dm4v, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FFDS, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ffds, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FVFW, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_fvfw, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_DXGM, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_dxgm, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_FMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_fmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_HDX4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_hdx4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_LMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_lmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_NDIG, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ndig, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_RMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_rmp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_SMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_smp4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_SEDG, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_sedg, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_UMP4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_ump4, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_WV1F, AV_CODEC_ID_MPEG4, NULL },
- { &MEDIASUBTYPE_wv1f, AV_CODEC_ID_MPEG4, NULL }
+ { &MEDIASUBTYPE_MP4V, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_mp4v, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_M4S2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_m4s2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_MP4S, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_mp4s, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IV1, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3iv1, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IV2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3iv2, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3IVX, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_3ivx, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_BLZ0, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_blz0, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DM4V, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dm4v, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FFDS, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ffds, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FVFW, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_fvfw, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_DXGM, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_dxgm, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_FMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_fmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_HDX4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_hdx4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_LMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_lmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_NDIG, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ndig, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_RMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_rmp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_SMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_smp4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_SEDG, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_sedg, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_UMP4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_ump4, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_WV1F, AV_CODEC_ID_MPEG4, nullptr },
+ { &MEDIASUBTYPE_wv1f, AV_CODEC_ID_MPEG4, nullptr }
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
};
@@ -526,7 +526,7 @@ BOOL CALLBACK EnumFindProcessWnd(HWND hwnd, LPARAM lParam)
CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
: CBaseVideoFilter(MPCVideoDecName, lpunk, phr, __uuidof(this))
{
- HWND hWnd = NULL;
+ HWND hWnd = nullptr;
if (SysVersion::IsVistaOrLater()) {
for (int i = 0; i < _countof(ffCodecs); i++) {
@@ -549,9 +549,9 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
}
m_pCpuId = DEBUG_NEW CCpuId();
- m_pAVCodec = NULL;
- m_pAVCtx = NULL;
- m_pFrame = NULL;
+ m_pAVCodec = nullptr;
+ m_pAVCtx = nullptr;
+ m_pFrame = nullptr;
m_nCodecNb = -1;
m_nCodecId = AV_CODEC_ID_NONE;
m_bReorderBFrame = true;
@@ -573,22 +573,22 @@ CMPCVideoDecFilter::CMPCVideoDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
m_nThreadNumber = 0;
m_nDiscardMode = AVDISCARD_DEFAULT;
m_bDXVACompatible = true;
- m_pFFBuffer = NULL;
+ m_pFFBuffer = nullptr;
m_nFFBufferSize = 0;
- m_pAlignedFFBuffer = NULL;
+ m_pAlignedFFBuffer = nullptr;
m_nAlignedFFBufferSize = 0;
ResetBuffer();
m_nWidth = 0;
m_nHeight = 0;
- m_pSwsContext = NULL;
+ m_pSwsContext = nullptr;
m_bUseDXVA = true;
m_bUseFFmpeg = true;
m_nDXVAMode = MODE_SOFTWARE;
- m_pDXVADecoder = NULL;
- m_pVideoOutputFormat = NULL;
+ m_pDXVADecoder = nullptr;
+ m_pVideoOutputFormat = nullptr;
m_nVideoOutputCount = 0;
m_hDevice = INVALID_HANDLE_VALUE;
@@ -950,14 +950,14 @@ void CMPCVideoDecFilter::Cleanup()
#if HAS_FFMPEG_VIDEO_DECODERS
if (m_pSwsContext) {
sws_freeContext(m_pSwsContext);
- m_pSwsContext = NULL;
+ m_pSwsContext = nullptr;
}
#endif /* HAS_FFMPEG_VIDEO_DECODERS */
- m_pAVCodec = NULL;
- m_pAVCtx = NULL;
- m_pFrame = NULL;
- m_pFFBuffer = NULL;
+ m_pAVCodec = nullptr;
+ m_pAVCtx = nullptr;
+ m_pFrame = nullptr;
+ m_pFFBuffer = nullptr;
m_nFFBufferSize = 0;
m_nFFBufferPos = 0;
m_nFFPicEnd = INT_MIN;
@@ -971,9 +971,9 @@ void CMPCVideoDecFilter::Cleanup()
m_hDevice = INVALID_HANDLE_VALUE;
}
- m_pDeviceManager = NULL;
- m_pDecoderService = NULL;
- m_pDecoderRenderTarget = NULL;
+ m_pDeviceManager = nullptr;
+ m_pDecoderService = nullptr;
+ m_pDecoderRenderTarget = nullptr;
}
void CMPCVideoDecFilter::CalcAvgTimePerFrame()
@@ -1059,7 +1059,7 @@ CString CMPCVideoDecFilter::GetFileExtension()
BeginEnumFilters(m_pGraph, pEF, pBF) {
CComQIPtr<IFileSourceFilter> pFSF = pBF;
if (pFSF) {
- LPOLESTR pFN = NULL;
+ LPOLESTR pFN = nullptr;
AM_MEDIA_TYPE mt;
if (SUCCEEDED(pFSF->GetCurFile(&pFN, &mt)) && pFN && *pFN) {
ext = CPath(CStringW(pFN)).GetExtension();
@@ -1141,7 +1141,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy
m_pAVCtx->codec_tag = mpg2v->hdr.bmiHeader.biCompression;
m_pAVCtx->bits_per_coded_sample = mpg2v->hdr.bmiHeader.biBitCount;
- if (mpg2v->hdr.bmiHeader.biCompression == NULL) {
+ if (mpg2v->hdr.bmiHeader.biCompression == 0) {
m_pAVCtx->codec_tag = pmt->subtype.Data1;
} else if ((m_pAVCtx->codec_tag == MAKEFOURCC('a', 'v', 'c', '1')) || (m_pAVCtx->codec_tag == MAKEFOURCC('A', 'V', 'C', '1'))) {
m_pAVCtx->nal_length_size = mpg2v->dwFlags;
@@ -1184,7 +1184,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy
ConnectTo(m_pAVCtx);
CalcAvgTimePerFrame();
- if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) < 0) {
+ if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) < 0) {
return VFW_E_INVALIDMEDIATYPE;
}
@@ -1234,7 +1234,7 @@ HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction, const CMediaTy
if ((nThreadNumber > 1) && IsMultiThreadSupported(m_nCodecId)) {
FFSetThreadNumber(m_pAVCtx, m_nCodecId, nThreadNumber);
}
- if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) < 0) {
+ if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) < 0) {
return VFW_E_INVALIDMEDIATYPE;
}
}
@@ -1280,7 +1280,7 @@ bool CMPCVideoDecFilter::IsDXVASupported()
{
if (m_nCodecNb != -1) {
// Does the codec suppport DXVA ?
- if (ffCodecs[m_nCodecNb].DXVAModes != NULL) {
+ if (ffCodecs[m_nCodecNb].DXVAModes != nullptr) {
// Enabled by user ?
if (m_bUseDXVA) {
// is the file compatible ?
@@ -1349,9 +1349,9 @@ void CMPCVideoDecFilter::AllocExtradata(AVCodecContext* pAVCtx, const CMediaType
{
// code from LAV ...
// Process Extradata
- BYTE* extra = NULL;
+ BYTE* extra = nullptr;
unsigned int extralen = 0;
- getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), NULL, &extralen);
+ getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), nullptr, &extralen);
BOOL bH264avc = FALSE;
if (extralen > 0) {
@@ -1402,7 +1402,7 @@ void CMPCVideoDecFilter::AllocExtradata(AVCodecContext* pAVCtx, const CMediaType
} else {
// Just copy extradata for other formats
extra = (uint8_t*)av_mallocz(extralen + FF_INPUT_BUFFER_PADDING_SIZE);
- getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), extra, NULL);
+ getExtraData((const BYTE*)pmt->Format(), pmt->FormatType(), pmt->FormatLength(), extra, nullptr);
}
// Hack to discard invalid MP4 metadata with AnnexB style video
if (m_nCodecId == AV_CODEC_ID_H264 && !bH264avc && extra[0] == 1) {
@@ -1515,7 +1515,7 @@ HRESULT CMPCVideoDecFilter::EndOfStream()
#if HAS_FFMPEG_VIDEO_DECODERS
if (m_nDXVAMode == MODE_SOFTWARE) {
REFERENCE_TIME rtStart = 0, rtStop = 0;
- SoftwareDecode(NULL, NULL, 0, rtStart, rtStop);
+ SoftwareDecode(nullptr, nullptr, 0, rtStart, rtStop);
} else
#endif
if (m_nDXVAMode == MODE_DXVA2) { // TODO - need to check DXVA1 on WinXP
@@ -1592,7 +1592,7 @@ unsigned __int64 CMPCVideoDecFilter::GetCspFromMediaType(GUID& subtype)
void CMPCVideoDecFilter::InitSwscale()
{
- if (m_pSwsContext == NULL) {
+ if (m_pSwsContext == nullptr) {
BITMAPINFOHEADER bihOut;
ExtractBIH(&m_pOutput->CurrentMediaType(), &bihOut);
@@ -1606,7 +1606,7 @@ void CMPCVideoDecFilter::InitSwscale()
}
m_pSwsContext = sws_getCachedContext(
- NULL,
+ nullptr,
m_pAVCtx->width,
m_pAVCtx->height,
pix_fmt,
@@ -1614,15 +1614,15 @@ void CMPCVideoDecFilter::InitSwscale()
m_pAVCtx->height,
csp_ffdshow2lavc(m_nOutCsp),
sws_Flags | SWS_PRINT_INFO,
- NULL,
- NULL,
- NULL);
+ nullptr,
+ nullptr,
+ nullptr);
m_nSwOutBpp = bihOut.biBitCount;
m_pOutSize.cx = bihOut.biWidth;
m_pOutSize.cy = abs(bihOut.biHeight);
- int* inv_tbl = NULL, *tbl = NULL;
+ int* inv_tbl = nullptr, *tbl = nullptr;
int srcRange, dstRange, brightness, contrast, saturation;
int ret = sws_getColorspaceDetails(m_pSwsContext, &inv_tbl, &srcRange, &tbl, &dstRange, &brightness, &contrast, &saturation);
if (ret >= 0) {
@@ -1709,7 +1709,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
HRESULT hr = S_OK;
int got_picture;
int used_bytes;
- BOOL bFlush = (pDataIn == NULL);
+ BOOL bFlush = (pDataIn == nullptr);
AVPacket avpkt;
av_init_packet(&avpkt);
@@ -1745,7 +1745,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
avpkt.dts = rtStop;
avpkt.flags = AV_PKT_FLAG_KEY;
} else {
- avpkt.data = NULL;
+ avpkt.data = nullptr;
avpkt.size = 0;
}
used_bytes = avcodec_decode_video2(m_pAVCtx, m_pFrame, &got_picture, &avpkt);
@@ -1791,7 +1791,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
}
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
UpdateAspectRatio();
if (FAILED(hr = GetDeliveryBuffer(m_pAVCtx->width, m_pAVCtx->height, &pOut)) || FAILED(hr = pOut->GetPointer(&pDataOut))) {
@@ -1817,12 +1817,12 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
ReorderBFrames(rtStart, rtStop);
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
- if (m_pSwsContext == NULL) {
+ if (m_pSwsContext == nullptr) {
InitSwscale();
}
- if (m_pSwsContext != NULL) {
+ if (m_pSwsContext != nullptr) {
int outStride = m_pOutSize.cx;
BYTE* outData = pDataOut;
@@ -1840,7 +1840,7 @@ HRESULT CMPCVideoDecFilter::SoftwareDecode(IMediaSample* pIn, BYTE* pDataIn, int
outData = m_pAlignedFFBuffer;
}
- uint8_t* dst[4] = {NULL, NULL, NULL, NULL};
+ uint8_t* dst[4] = {nullptr, nullptr, nullptr, nullptr};
stride_t dstStride[4] = {0, 0, 0, 0};
const TcspInfo* outcspInfo = csp_getInfo(m_nOutCsp);
@@ -2142,8 +2142,8 @@ HRESULT CMPCVideoDecFilter::FindDXVA2DecoderConfiguration(IDirectXVideoDecoderSe
UINT cConfigurations = 0;
bool bIsPrefered = false;
- D3DFORMAT* pFormats = NULL; // size = cFormats
- DXVA2_ConfigPictureDecode* pConfig = NULL; // size = cConfigurations
+ D3DFORMAT* pFormats = nullptr; // size = cFormats
+ DXVA2_ConfigPictureDecode* pConfig = nullptr; // size = cConfigurations
// Find the valid render target formats for this decoder GUID.
hr = pDecoderService->GetDecoderRenderTargets(guidDecoder, &cFormats, &pFormats);
@@ -2159,7 +2159,7 @@ HRESULT CMPCVideoDecFilter::FindDXVA2DecoderConfiguration(IDirectXVideoDecoderSe
m_VideoDesc.Format = pFormats[iFormat];
// Get the available configurations.
- hr = pDecoderService->GetDecoderConfigurations(guidDecoder, &m_VideoDesc, NULL, &cConfigurations, &pConfig);
+ hr = pDecoderService->GetDecoderConfigurations(guidDecoder, &m_VideoDesc, nullptr, &cConfigurations, &pConfig);
if (FAILED(hr)) {
continue;
@@ -2204,7 +2204,7 @@ HRESULT CMPCVideoDecFilter::ConfigureDXVA2(IPin* pPin)
CComPtr<IMFGetService> pGetService;
CComPtr<IDirect3DDeviceManager9> pDeviceManager;
CComPtr<IDirectXVideoDecoderService> pDecoderService;
- GUID* pDecoderGuids = NULL;
+ GUID* pDecoderGuids = nullptr;
HANDLE hDevice = INVALID_HANDLE_VALUE;
// Query the pin for IMFGetService.
@@ -2353,10 +2353,10 @@ HRESULT CMPCVideoDecFilter::CreateDXVA2Decoder(UINT nNumRenderTargets, IDirect3D
HRESULT hr;
CComPtr<IDirectXVideoDecoder> pDirectXVideoDec;
- m_pDecoderRenderTarget = NULL;
+ m_pDecoderRenderTarget = nullptr;
if (m_pDXVADecoder) {
- m_pDXVADecoder->SetDirectXVideoDec(NULL);
+ m_pDXVADecoder->SetDirectXVideoDec(nullptr);
}
hr = m_pDecoderService->CreateVideoDecoder(m_DXVADecoderGUID, &m_VideoDesc, &m_DXVA2Config,
@@ -2384,10 +2384,10 @@ HRESULT CMPCVideoDecFilter::FindDXVA1DecoderConfiguration(IAMVideoAccelerator* p
{
HRESULT hr = E_FAIL;
DWORD dwFormats = 0;
- DDPIXELFORMAT* pPixelFormats = NULL;
+ DDPIXELFORMAT* pPixelFormats = nullptr;
- pAMVideoAccelerator->GetUncompFormatsSupported(guidDecoder, &dwFormats, NULL);
+ pAMVideoAccelerator->GetUncompFormatsSupported(guidDecoder, &dwFormats, nullptr);
if (dwFormats > 0) {
// Find the valid render target formats for this decoder GUID.
pPixelFormats = DEBUG_NEW DDPIXELFORMAT[dwFormats];
@@ -2478,7 +2478,7 @@ STDMETHODIMP CMPCVideoDecFilter::GetPages(CAUUID* pPages)
#endif
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMPCVideoDecSettingsWnd);
if (pPages->cElems > 1) {
pPages->pElems[1] = __uuidof(CMPCVideoDecCodecWnd);
@@ -2494,16 +2494,16 @@ STDMETHODIMP CMPCVideoDecFilter::CreatePage(const GUID& guid, IPropertyPage** pp
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMPCVideoDecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecSettingsWnd>(nullptr, &hr))->AddRef();
} else if (guid == __uuidof(CMPCVideoDecCodecWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMPCVideoDecCodecWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -2570,8 +2570,8 @@ STDMETHODIMP_(int) CMPCVideoDecFilter::GetDiscardMode()
STDMETHODIMP_(GUID*) CMPCVideoDecFilter::GetDXVADecoderGuid()
{
- if (m_pGraph == NULL) {
- return NULL;
+ if (m_pGraph == nullptr) {
+ return nullptr;
} else {
return &m_DXVADecoderGUID;
}
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp
index 71bbb0056..dfe2fb24b 100644
--- a/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp
+++ b/src/filters/transform/MPCVideoDec/MPCVideoDecSettingsWnd.cpp
@@ -101,7 +101,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate()
const int h25 = IPP_SCALE(25);
DWORD dwStyle = WS_VISIBLE | WS_CHILD | WS_TABSTOP;
CPoint p(10, 10);
- GUID* DxvaGui = NULL;
+ GUID* DxvaGui = nullptr;
#if HAS_FFMPEG_VIDEO_DECODERS
m_grpFFMpeg.Create(ResStr(IDS_VDF_FFSETTINGS), WS_VISIBLE | WS_CHILD | BS_GROUPBOX, CRect(p + CPoint(-5, 0), CSize(IPP_SCALE(350), h20 + h25 * 3 + h20)), this, (UINT)IDC_STATIC);
@@ -174,7 +174,7 @@ bool CMPCVideoDecSettingsWnd::OnActivate()
m_edtVideoCardDescription.SetWindowText(m_pMDF->GetVideoCardDescription());
DxvaGui = m_pMDF->GetDXVADecoderGuid();
- if (DxvaGui != NULL) {
+ if (DxvaGui != nullptr) {
CString DXVAMode = GetDXVAMode(DxvaGui);
m_edtDXVAMode.SetWindowText(DXVAMode);
} else {
diff --git a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp
index 759380dc1..1d450ae1f 100644
--- a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp
+++ b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp
@@ -28,7 +28,7 @@
CDXVA2Sample::CDXVA2Sample(CVideoDecDXVAAllocator* pAlloc, HRESULT* phr)
- : CMediaSample(NAME("CDXVA2Sample"), (CBaseAllocator*)pAlloc, phr, NULL, 0)
+ : CMediaSample(NAME("CDXVA2Sample"), (CBaseAllocator*)pAlloc, phr, nullptr, 0)
, m_dwSurfaceId(0)
{
}
@@ -68,7 +68,7 @@ STDMETHODIMP CDXVA2Sample::GetService(REFGUID guidService, REFIID riid, LPVOID*
{
if (guidService != MR_BUFFER_SERVICE) {
return MF_E_UNSUPPORTED_SERVICE;
- } else if (m_pSurface == NULL) {
+ } else if (m_pSurface == nullptr) {
return E_NOINTERFACE;
} else {
return m_pSurface->QueryInterface(riid, ppv);
@@ -95,9 +95,9 @@ STDMETHODIMP_(int) CDXVA2Sample::GetDXSurfaceId()
}
CVideoDecDXVAAllocator::CVideoDecDXVAAllocator(CMPCVideoDecFilter* pVideoDecFilter, HRESULT* phr)
- : CBaseAllocator(NAME("CVideoDecDXVAAllocator"), NULL, phr)
+ : CBaseAllocator(NAME("CVideoDecDXVAAllocator"), nullptr, phr)
, m_pVideoDecFilter(pVideoDecFilter)
- , m_ppRTSurfaceArray(NULL)
+ , m_ppRTSurfaceArray(nullptr)
, m_nSurfaceArrayCount(0)
{
}
@@ -127,7 +127,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc()
// Allocate a new array of pointers.
m_ppRTSurfaceArray = DEBUG_NEW IDirect3DSurface9 * [m_lCount];
- if (m_ppRTSurfaceArray == NULL) {
+ if (m_ppRTSurfaceArray == nullptr) {
hr = E_OUTOFMEMORY;
} else {
ZeroMemory(m_ppRTSurfaceArray, sizeof(IDirect3DSurface9*) * m_lCount);
@@ -146,7 +146,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc()
0,
DXVA2_VideoDecoderRenderTarget,
m_ppRTSurfaceArray,
- NULL
+ nullptr
);
}
@@ -154,7 +154,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc()
// Important : create samples in reverse order !
for (m_lAllocated = m_lCount - 1; m_lAllocated >= 0; m_lAllocated--) {
CDXVA2Sample* pSample = DEBUG_NEW CDXVA2Sample(this, &hr);
- if (pSample == NULL) {
+ if (pSample == nullptr) {
hr = E_OUTOFMEMORY;
break;
}
@@ -182,7 +182,7 @@ HRESULT CVideoDecDXVAAllocator::Alloc()
void CVideoDecDXVAAllocator::Free()
{
- CMediaSample* pSample = NULL;
+ CMediaSample* pSample = nullptr;
m_pVideoDecFilter->FlushDXVADecoder();
// m_FreeSurface.RemoveAll();
@@ -195,13 +195,13 @@ void CVideoDecDXVAAllocator::Free()
if (m_ppRTSurfaceArray) {
for (UINT i = 0; i < m_nSurfaceArrayCount; i++) {
- if (m_ppRTSurfaceArray[i] != NULL) {
+ if (m_ppRTSurfaceArray[i] != nullptr) {
m_ppRTSurfaceArray[i]->Release();
}
}
delete [] m_ppRTSurfaceArray;
- m_ppRTSurfaceArray = NULL;
+ m_ppRTSurfaceArray = nullptr;
}
m_lAllocated = 0;
m_nSurfaceArrayCount = 0;
diff --git a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
index 2032731c3..9f38a7852 100644
--- a/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
+++ b/src/filters/transform/MPCVideoDec/VideoDecOutputPin.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2007-2012 see Authors.txt
+ * (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -28,7 +28,7 @@ CVideoDecOutputPin::CVideoDecOutputPin(TCHAR* pObjectName, CBaseVideoFilter* pFi
: CBaseVideoOutputPin(pObjectName, pFilter, phr, pName)
{
m_pVideoDecFilter = static_cast<CMPCVideoDecFilter*>(pFilter);
- m_pDXVA2Allocator = NULL;
+ m_pDXVA2Allocator = nullptr;
m_dwDXVA1SurfaceCount = 0;
m_GuidDecoderDXVA1 = GUID_NULL;
memset(&m_ddUncompPixelFormat, 0, sizeof(m_ddUncompPixelFormat));
@@ -115,7 +115,7 @@ STDMETHODIMP CVideoDecOutputPin::GetCreateVideoAcceleratorData(const GUID* pGuid
m_pVideoDecFilter->SetDXVA1Params(&m_GuidDecoderDXVA1, &m_ddUncompPixelFormat);
pConnectMode = (DXVA_ConnectMode*)CoTaskMemAlloc(sizeof(DXVA_ConnectMode));
- if (pConnectMode != NULL) {
+ if (pConnectMode != nullptr) {
pConnectMode->guidMode = m_GuidDecoderDXVA1;
pConnectMode->wRestrictedMode = m_pVideoDecFilter->GetDXVA1RestrictedMode();
*pdwSizeMiscData = sizeof(DXVA_ConnectMode);
diff --git a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
index 6488010df..8dc2ef37e 100644
--- a/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
+++ b/src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
@@ -168,10 +168,10 @@ void CFFAudioDecoder::LogLibavcodec(void* par, int level, const char* fmt, va_li
}
CFFAudioDecoder::CFFAudioDecoder()
- : m_pAVCodec(NULL)
- , m_pAVCtx(NULL)
- , m_pParser(NULL)
- , m_pFrame(NULL)
+ : m_pAVCodec(nullptr)
+ , m_pAVCtx(nullptr)
+ , m_pParser(nullptr)
+ , m_pFrame(nullptr)
{
memset(&m_raData, 0, sizeof(m_raData));
}
@@ -234,14 +234,14 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput)
GUID format_type = pInput->CurrentMediaType().formattype;
DWORD formatlen = pInput->CurrentMediaType().cbFormat;
unsigned extralen = 0;
- getExtraData((BYTE*)format, &format_type, formatlen, NULL, &extralen);
+ getExtraData((BYTE*)format, &format_type, formatlen, nullptr, &extralen);
memset(&m_raData, 0, sizeof(m_raData));
if (extralen) {
if (nCodecId == AV_CODEC_ID_COOK || nCodecId == AV_CODEC_ID_ATRAC3 || nCodecId == AV_CODEC_ID_SIPR) {
uint8_t* extra = (uint8_t*)av_mallocz(extralen + FF_INPUT_BUFFER_PADDING_SIZE);
- getExtraData((BYTE*)format, &format_type, formatlen, extra, NULL);
+ getExtraData((BYTE*)format, &format_type, formatlen, extra, nullptr);
if (extra[0] == '.' && extra[1] == 'r' && extra[2] == 'a' && extra[3] == 0xfd) {
HRESULT hr = ParseRealAudioHeader(extra, extralen);
@@ -265,11 +265,11 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput)
} else {
m_pAVCtx->extradata_size = extralen;
m_pAVCtx->extradata = (uint8_t*)av_mallocz(m_pAVCtx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- getExtraData((BYTE*)format, &format_type, formatlen, (BYTE*)m_pAVCtx->extradata, NULL);
+ getExtraData((BYTE*)format, &format_type, formatlen, (BYTE*)m_pAVCtx->extradata, nullptr);
}
}
- if (avcodec_open2(m_pAVCtx, m_pAVCodec, NULL) >= 0) {
+ if (avcodec_open2(m_pAVCtx, m_pAVCodec, nullptr) >= 0) {
m_pFrame = avcodec_alloc_frame();
bRet = true;
}
@@ -308,7 +308,7 @@ HRESULT CFFAudioDecoder::Decode(enum AVCodecID nCodecId, BYTE* p, int buffsize,
av_init_packet(&avpkt);
if (b_use_parse) {
- BYTE* pOut = NULL;
+ BYTE* pOut = nullptr;
int pOut_size = 0;
int used_bytes = av_parser_parse2(m_pParser, m_pAVCtx, &pOut, &pOut_size, p, buffsize, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
@@ -396,7 +396,7 @@ void CFFAudioDecoder::FlushBuffers()
void CFFAudioDecoder::StreamFinish()
{
- m_pAVCodec = NULL;
+ m_pAVCodec = nullptr;
if (m_pAVCtx) {
if (m_pAVCtx->extradata) {
av_freep(&m_pAVCtx->extradata);
@@ -409,7 +409,7 @@ void CFFAudioDecoder::StreamFinish()
if (m_pParser) {
av_parser_close(m_pParser);
- m_pParser = NULL;
+ m_pParser = nullptr;
}
if (m_pFrame) {
diff --git a/src/filters/transform/MpaDecFilter/Mixer.cpp b/src/filters/transform/MpaDecFilter/Mixer.cpp
index a566c5b52..8c3aeece4 100644
--- a/src/filters/transform/MpaDecFilter/Mixer.cpp
+++ b/src/filters/transform/MpaDecFilter/Mixer.cpp
@@ -31,8 +31,8 @@ extern "C" {
#include "AudioHelper.h"
CMixer::CMixer()
- : m_pAVRCxt(NULL)
- , m_matrix_dbl(NULL)
+ : m_pAVRCxt(nullptr)
+ , m_matrix_dbl(nullptr)
, m_in_avsf(AV_SAMPLE_FMT_NONE)
, m_in_layout(0)
, m_out_layout(0)
diff --git a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
index 8193d3f91..b874d942b 100644
--- a/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
+++ b/src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
@@ -197,8 +197,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -206,7 +206,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, &__uuidof(CMpaDecFilter), CreateInstance<CMpaDecFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, &__uuidof(CMpaDecFilter), CreateInstance<CMpaDecFilter>, nullptr, &sudFilter[0]},
{L"CMpaDecPropertyPage", &__uuidof(CMpaDecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpaDecSettingsWnd>>},
};
@@ -352,7 +352,7 @@ CMpaDecFilter::CMpaDecFilter(LPUNKNOWN lpunk, HRESULT* phr)
*phr = E_OUTOFMEMORY;
}
if (FAILED(*phr)) {
- delete m_pInput, m_pInput = NULL;
+ delete m_pInput, m_pInput = nullptr;
return;
}
@@ -507,10 +507,10 @@ HRESULT CMpaDecFilter::Receive(IMediaSample* pIn)
CMediaType mt(*pmt);
m_pInput->SetMediaType(&mt);
DeleteMediaType(pmt);
- pmt = NULL;
+ pmt = nullptr;
}
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -1494,19 +1494,19 @@ HRESULT CMpaDecFilter::ProcessPS2ADPCM()
HRESULT CMpaDecFilter::GetDeliveryBuffer(IMediaSample** pSample, BYTE** pData)
{
HRESULT hr;
- *pData = NULL;
+ *pData = nullptr;
- if (FAILED(hr = m_pOutput->GetDeliveryBuffer(pSample, NULL, NULL, 0))
+ if (FAILED(hr = m_pOutput->GetDeliveryBuffer(pSample, nullptr, nullptr, 0))
|| FAILED(hr = (*pSample)->GetPointer(pData))) {
return hr;
}
- AM_MEDIA_TYPE* pmt = NULL;
+ AM_MEDIA_TYPE* pmt = nullptr;
if (SUCCEEDED((*pSample)->GetMediaType(&pmt)) && pmt) {
CMediaType mt = *pmt;
m_pOutput->SetMediaType(&mt);
DeleteMediaType(pmt);
- pmt = NULL;
+ pmt = nullptr;
}
return S_OK;
@@ -1584,7 +1584,7 @@ HRESULT CMpaDecFilter::Deliver(BYTE* pBuff, int size, AVSampleFormat avsf, DWORD
}
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(GetDeliveryBuffer(&pOut, &pDataOut))) {
return E_FAIL;
}
@@ -1595,7 +1595,7 @@ HRESULT CMpaDecFilter::Deliver(BYTE* pBuff, int size, AVSampleFormat avsf, DWORD
}
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetPreroll(FALSE);
pOut->SetDiscontinuity(m_fDiscontinuity);
@@ -1681,7 +1681,7 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, int size, WORD type, int sa
}
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(GetDeliveryBuffer(&pOut, &pDataOut))) {
return E_FAIL;
}
@@ -1734,7 +1734,7 @@ HRESULT CMpaDecFilter::DeliverBitstream(BYTE* pBuff, int size, WORD type, int sa
}
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetPreroll(FALSE);
pOut->SetDiscontinuity(m_fDiscontinuity);
@@ -2000,7 +2000,7 @@ HRESULT CMpaDecFilter::GetMediaType(int iPosition, CMediaType* pmt)
CMediaType mt = m_pInput->CurrentMediaType();
WAVEFORMATEX* wfe = (WAVEFORMATEX*)mt.Format();
- if (wfe == NULL) {
+ if (wfe == nullptr) {
return E_INVALIDARG;
}
@@ -2296,7 +2296,7 @@ STDMETHODIMP CMpaDecFilter::GetPages(CAUUID* pPages)
pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpaDecSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -2309,14 +2309,14 @@ STDMETHODIMP CMpaDecFilter::CreatePage(const GUID& guid, IPropertyPage** ppPage)
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpaDecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpaDecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpaDecSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
index 95387e7f9..78d162ce2 100644
--- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
+++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp
@@ -62,8 +62,8 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut}
};
const AMOVIESETUP_FILTER sudFilter[] = {
@@ -71,7 +71,7 @@ const AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpeg2DecFilter>, NULL, &sudFilter[0]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CMpeg2DecFilter>, nullptr, &sudFilter[0]},
{L"CMpeg2DecPropertyPage", &__uuidof(CMpeg2DecSettingsWnd), CreateInstance<CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>>},
};
@@ -359,7 +359,7 @@ CBasePin* CMpeg2DecFilter::GetPin(int n)
case 3:
return m_pClosedCaptionOutput;
}
- return NULL;
+ return nullptr;
}
HRESULT CMpeg2DecFilter::EndOfStream()
@@ -403,7 +403,7 @@ void CMpeg2DecFilter::InputTypeChanged()
const CMediaType& mt = m_pInput->CurrentMediaType();
- BYTE* pSequenceHeader = NULL;
+ BYTE* pSequenceHeader = nullptr;
DWORD cbSequenceHeader = 0;
if (mt.formattype == FORMAT_MPEGVideo) {
@@ -516,7 +516,7 @@ HRESULT CMpeg2DecFilter::Transform(IMediaSample* pIn)
{
HRESULT hr;
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pIn->GetPointer(&pDataIn))) {
return hr;
}
@@ -685,7 +685,7 @@ HRESULT CMpeg2DecFilter::DeliverFast()
}
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(m_fb.w, m_fb.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
@@ -745,7 +745,7 @@ HRESULT CMpeg2DecFilter::DeliverFast()
rtStop = m_rate.StartTime + (rtStop - m_rate.StartTime) * m_rate.Rate / 10000;
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
//
@@ -866,7 +866,7 @@ HRESULT CMpeg2DecFilter::Deliver(bool fRepeatLast)
HRESULT hr;
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(m_fb.w, m_fb.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
@@ -910,7 +910,7 @@ HRESULT CMpeg2DecFilter::Deliver(bool fRepeatLast)
rtStop = m_rate.StartTime + (rtStop - m_rate.StartTime) * m_rate.Rate / 10000;
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
//
@@ -1094,7 +1094,7 @@ STDMETHODIMP CMpeg2DecFilter::GetPages(CAUUID* pPages)
pPages->cElems = 1;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems != NULL) {
+ if (pPages->pElems != nullptr) {
pPages->pElems[0] = __uuidof(CMpeg2DecSettingsWnd);
} else {
hr = E_OUTOFMEMORY;
@@ -1107,14 +1107,14 @@ STDMETHODIMP CMpeg2DecFilter::CreatePage(const GUID& guid, IPropertyPage** ppPag
{
CheckPointer(ppPage, E_POINTER);
- if (*ppPage != NULL) {
+ if (*ppPage != nullptr) {
return E_INVALIDARG;
}
HRESULT hr;
if (guid == __uuidof(CMpeg2DecSettingsWnd)) {
- (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>(NULL, &hr))->AddRef();
+ (*ppPage = DEBUG_NEW CInternalPropertyPageTempl<CMpeg2DecSettingsWnd>(nullptr, &hr))->AddRef();
}
return *ppPage ? S_OK : E_FAIL;
@@ -1694,7 +1694,7 @@ HRESULT CSubpicInputPin::Transform(IMediaSample* pSample)
DeleteMediaType(pmt);
}
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(hr = pSample->GetPointer(&pDataIn))) {
return hr;
}
@@ -2426,8 +2426,8 @@ HRESULT CClosedCaptionOutputPin::Deliver(const void* ptr, int len)
if (len > 4 && ptr && *(DWORD*)ptr == 0xf8014343 && IsConnected()) {
CComPtr<IMediaSample> pSample;
- GetDeliveryBuffer(&pSample, NULL, NULL, 0);
- BYTE* pData = NULL;
+ GetDeliveryBuffer(&pSample, nullptr, nullptr, 0);
+ BYTE* pData = nullptr;
pSample->GetPointer(&pData);
*(DWORD*)pData = 0xb2010000;
memcpy(pData + 4, ptr, len);
diff --git a/src/filters/transform/VSFilter/DirectVobSub.cpp b/src/filters/transform/VSFilter/DirectVobSub.cpp
index 2f1d0aa3a..3347baa42 100644
--- a/src/filters/transform/VSFilter/DirectVobSub.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSub.cpp
@@ -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.
*
@@ -51,7 +51,7 @@ CDirectVobSub::CDirectVobSub()
m_SubtitleSpeedDiv = theApp.GetProfileInt(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_SUBTITLESPEEDDIV), 1000);
m_fMediaFPSEnabled = !!theApp.GetProfileInt(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPSENABLED), 0);
m_ePARCompensationType = static_cast<CSimpleTextSubtitle::EPARCompensationType>(theApp.GetProfileInt(ResStr(IDS_R_TEXT), ResStr(IDS_RT_AUTOPARCOMPENSATION), 0));
- pData = NULL;
+ pData = nullptr;
if (theApp.GetProfileBinary(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPS), &pData, &nSize) && pData) {
if (nSize != sizeof(m_MediaFPS)) {
m_MediaFPS = 25.0;
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
index a007d4140..1315bc172 100644
--- a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp
@@ -64,9 +64,9 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI
lf.lfOutPrecision = OUT_CHARACTER_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = ANTIALIASED_QUALITY;
- HDC hdc = GetDC(NULL);
+ HDC hdc = GetDC(nullptr);
lf.lfHeight = -MulDiv(10, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- ReleaseDC(NULL, hdc);
+ ReleaseDC(nullptr, hdc);
lf.lfWeight = FW_BOLD;
_tcscpy_s(lf.lfFaceName, _T("Arial"));
m_hfont = CreateFontIndirect(&lf);
@@ -80,8 +80,8 @@ CDirectVobSubFilter::CDirectVobSubFilter(LPUNKNOWN punk, HRESULT* phr, const GUI
m_fLoading = true;
m_hSystrayThread = 0;
- m_tbid.hSystrayWnd = NULL;
- m_tbid.graph = NULL;
+ m_tbid.hSystrayWnd = nullptr;
+ m_tbid.graph = nullptr;
m_tbid.fRunOnce = false;
m_tbid.fShowIcon = (theApp.m_AppName.Find(_T("zplayer"), 0) < 0 || !!theApp.GetProfileInt(ResStr(IDS_R_GENERAL), ResStr(IDS_RG_ENABLEZPICON), 0));
@@ -102,7 +102,7 @@ CDirectVobSubFilter::~CDirectVobSubFilter()
if (m_pSubPicQueue) {
m_pSubPicQueue->Invalidate();
}
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
if (m_hfont) {
DeleteObject(m_hfont);
@@ -198,7 +198,7 @@ HRESULT CDirectVobSubFilter::Transform(IMediaSample* pIn)
//
- BYTE* pDataIn = NULL;
+ BYTE* pDataIn = nullptr;
if (FAILED(pIn->GetPointer(&pDataIn)) || !pDataIn) {
return S_FALSE;
}
@@ -247,14 +247,14 @@ HRESULT CDirectVobSubFilter::Transform(IMediaSample* pIn)
//
CComPtr<IMediaSample> pOut;
- BYTE* pDataOut = NULL;
+ BYTE* pDataOut = nullptr;
if (FAILED(hr = GetDeliveryBuffer(spd.w, spd.h, &pOut))
|| FAILED(hr = pOut->GetPointer(&pDataOut))) {
return hr;
}
pOut->SetTime(&rtStart, &rtStop);
- pOut->SetMediaTime(NULL, NULL);
+ pOut->SetMediaTime(nullptr, nullptr);
pOut->SetDiscontinuity(pIn->IsDiscontinuity() == S_OK);
pOut->SetSyncPoint(pIn->IsSyncPoint() == S_OK);
@@ -324,7 +324,7 @@ CBasePin* CDirectVobSubFilter::GetPin(int n)
n -= (int)m_pTextInput.GetCount();
- return NULL;
+ return nullptr;
}
int CDirectVobSubFilter::GetPinCount()
@@ -462,7 +462,7 @@ HRESULT CDirectVobSubFilter::BreakConnect(PIN_DIRECTION dir)
} else if (dir == PINDIR_OUTPUT) {
// not really needed, but may free up a little memory
CAutoLock cAutoLock(&m_csQueueLock);
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
}
return __super::BreakConnect(dir);
@@ -509,7 +509,7 @@ void CDirectVobSubFilter::InitSubPicQueue()
{
CAutoLock cAutoLock(&m_csQueueLock);
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
m_pTempPicBuff.Free();
m_pTempPicBuff.Allocate(4 * m_w * m_h);
@@ -559,26 +559,26 @@ void CDirectVobSubFilter::InitSubPicQueue()
: (ISubPicQueue*)DEBUG_NEW CSubPicQueueNoThread(pSubPicAllocator, &hr);
if (FAILED(hr)) {
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
}
UpdateSubtitle(false);
if (m_hbm) {
DeleteObject(m_hbm);
- m_hbm = NULL;
+ m_hbm = nullptr;
}
if (m_hdc) {
DeleteDC(m_hdc);
- m_hdc = NULL;
+ m_hdc = nullptr;
}
struct {
BITMAPINFOHEADER bih;
DWORD mask[3];
} b = {{sizeof(BITMAPINFOHEADER), m_w, -(int)m_h, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0}, 0xFF0000, 0x00FF00, 0x0000FF};
- m_hdc = CreateCompatibleDC(NULL);
- m_hbm = CreateDIBSection(m_hdc, (BITMAPINFO*)&b, DIB_RGB_COLORS, NULL, NULL, 0);
+ m_hdc = CreateCompatibleDC(nullptr);
+ m_hbm = CreateDIBSection(m_hdc, (BITMAPINFO*)&b, DIB_RGB_COLORS, nullptr, nullptr, 0);
BITMAP bm;
GetObject(m_hbm, sizeof(bm), &bm);
@@ -675,7 +675,7 @@ int CDirectVobSubFilter::FindPreferedLanguage(bool fHideToo)
if (!lang.IsEmpty()) {
for (int ret = 0; ret < nLangs; ret++) {
CString l;
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
get_LanguageName(ret, &pName);
l = pName;
CoTaskMemFree(pName);
@@ -771,7 +771,7 @@ STDMETHODIMP CDirectVobSubFilter::Enable(long lIndex, DWORD dwFlags)
put_HideSubtitles(false);
put_SelectedLanguage(i);
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
if (SUCCEEDED(get_LanguageName(i, &pName))) {
UpdatePreferedLanguages(CString(pName));
if (pName) {
@@ -825,7 +825,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
}
if (ppszName) {
- *ppszName = NULL;
+ *ppszName = nullptr;
CStringW str;
if (i == -1) {
@@ -848,7 +848,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
if (!str.IsEmpty()) {
*ppszName = (WCHAR*)CoTaskMemAlloc((str.GetLength() + 1) * sizeof(WCHAR));
- if (*ppszName == NULL) {
+ if (*ppszName == nullptr) {
return S_FALSE;
}
wcscpy_s(*ppszName, str.GetLength() + 1, str);
@@ -856,11 +856,11 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
}
if (ppObject) {
- *ppObject = NULL;
+ *ppObject = nullptr;
}
if (ppUnk) {
- *ppUnk = NULL;
+ *ppUnk = nullptr;
}
return S_OK;
@@ -868,7 +868,7 @@ STDMETHODIMP CDirectVobSubFilter::Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD*
STDMETHODIMP CDirectVobSubFilter::GetClassID(CLSID* pClsid)
{
- if (pClsid == NULL) {
+ if (pClsid == nullptr) {
return E_POINTER;
}
*pClsid = m_clsid;
@@ -882,7 +882,7 @@ STDMETHODIMP CDirectVobSubFilter::GetPages(CAUUID* pPages)
pPages->cElems = 7;
pPages->pElems = (GUID*)CoTaskMemAlloc(sizeof(GUID) * pPages->cElems);
- if (pPages->pElems == NULL) {
+ if (pPages->pElems == nullptr) {
return E_OUTOFMEMORY;
}
@@ -949,7 +949,7 @@ STDMETHODIMP CDirectVobSubFilter::get_LanguageName(int iLanguage, WCHAR** ppName
CComPtr<ISubStream> pSubStream = m_pSubStreams.GetNext(pos);
if (i < pSubStream->GetStreamCount()) {
- pSubStream->GetStreamInfo(i, ppName, NULL);
+ pSubStream->GetStreamInfo(i, ppName, nullptr);
hr = NOERROR;
break;
}
@@ -1237,7 +1237,7 @@ HRESULT CDirectVobSubFilter2::JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pNam
cmt.majortype = MEDIATYPE_Video;
cmt.subtype = MEDIASUBTYPE_YUY2;
cmt.formattype = FORMAT_VideoInfo;
- cmt.pUnk = NULL;
+ cmt.pUnk = nullptr;
cmt.bFixedSizeSamples = TRUE;
cmt.bTemporalCompression = TRUE;
cmt.lSampleSize = 384 * 288 * 2;
@@ -1386,8 +1386,8 @@ bool CDirectVobSubFilter2::ShouldWeAutoload(IFilterGraph* pGraph)
BeginEnumFilters(pGraph, pEF, pBF) {
if (CComQIPtr<IFileSourceFilter> pFSF = pBF) {
- LPOLESTR fnw = NULL;
- if (!pFSF || FAILED(pFSF->GetCurFile(&fnw, NULL)) || !fnw) {
+ LPOLESTR fnw = nullptr;
+ if (!pFSF || FAILED(pFSF->GetCurFile(&fnw, nullptr)) || !fnw) {
continue;
}
fn = CString(fnw);
@@ -1421,7 +1421,7 @@ void CDirectVobSubFilter2::GetRidOfInternalScriptRenderer()
&& SUCCEEDED(pPin->ConnectedTo(&pPinTo))) {
m_pGraph->Disconnect(pPinTo);
m_pGraph->Disconnect(pPin);
- m_pGraph->ConnectDirect(pPinTo, GetPin(2 + m_pTextInput.GetCount() - 1), NULL);
+ m_pGraph->ConnectDirect(pPinTo, GetPin(2 + m_pTextInput.GetCount() - 1), nullptr);
}
}
EndEnumPins;
@@ -1517,7 +1517,7 @@ void CDirectVobSubFilter::UpdateSubtitle(bool fApplyDefStyle)
if (!m_fHideSubtitles) {
int i = m_iSelectedLanguage;
- for (POSITION pos = m_pSubStreams.GetHeadPosition(); i >= 0 && pos; pSubStream = NULL) {
+ for (POSITION pos = m_pSubStreams.GetHeadPosition(); i >= 0 && pos; pSubStream = nullptr) {
pSubStream = m_pSubStreams.GetNext(pos);
if (i < pSubStream->GetStreamCount()) {
@@ -1764,7 +1764,7 @@ DWORD CDirectVobSubFilter::ThreadProc()
CFileStatus status;
if (CFileGetStatus(fn, status) && m_frd.mtime[i] != status.m_mtime) {
for (j = 0; j < 10; j++) {
- FILE* f = NULL;
+ FILE* f = nullptr;
if (!_tfopen_s(&f, fn, _T("rb+"))) {
fclose(f);
j = 0;
diff --git a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
index 1b7554358..0144a1aad 100644
--- a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
@@ -41,7 +41,7 @@ BOOL WINAPI MyGetDialogSize(int iResourceID, DLGPROC pDlgProc, LPARAM lParam, SI
pDlgProc,
lParam);
- if (hwnd == NULL) {
+ if (hwnd == nullptr) {
return FALSE;
}
@@ -80,8 +80,8 @@ STDMETHODIMP CDVSBasePPage::GetPageInfo(LPPROPPAGEINFO pPageInfo)
pPageInfo->cb = sizeof(PROPPAGEINFO);
pPageInfo->pszTitle = pszTitle;
- pPageInfo->pszDocString = NULL;
- pPageInfo->pszHelpFile = NULL;
+ pPageInfo->pszDocString = nullptr;
+ pPageInfo->pszHelpFile = nullptr;
pPageInfo->dwHelpContext = 0;
// Set defaults in case GetDialogSize fails
pPageInfo->size.cx = 340;
@@ -108,7 +108,7 @@ STDMETHODIMP CDVSBasePPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal
}
m_hwnd = CreateDialogParam(AfxGetResourceHandle(), MAKEINTRESOURCE(m_DialogId), hwndParent, DialogProc, (LPARAM)this);
- if (m_hwnd == NULL) {
+ if (m_hwnd == nullptr) {
return E_OUTOFMEMORY;
}
@@ -184,7 +184,7 @@ HRESULT CDVSBasePPage::OnConnect(IUnknown* pUnknown)
HRESULT CDVSBasePPage::OnDisconnect()
{
- if (m_pDirectVobSub == NULL) {
+ if (m_pDirectVobSub == nullptr) {
return E_UNEXPECTED;
}
@@ -294,7 +294,7 @@ void CDVSBasePPage::BindControl(UINT id, CWnd& control)
CDVSMainPPage::CDVSMainPPage(LPUNKNOWN pUnk, HRESULT* phr)
: CDVSBasePPage(NAME("DirectVobSub Property Page (main)"), pUnk, IDD_DVSMAINPAGE, IDD_DVSMAINPAGE)
, m_nLangs(0)
- , m_ppLangs(NULL)
+ , m_ppLangs(nullptr)
{
BindControl(IDC_FILENAME, m_fnedit);
BindControl(IDC_LANGCOMBO, m_langs);
@@ -319,7 +319,7 @@ void CDVSMainPPage::FreeLangs()
}
CoTaskMemFree(m_ppLangs);
m_nLangs = 0;
- m_ppLangs = NULL;
+ m_ppLangs = nullptr;
}
}
@@ -338,7 +338,7 @@ bool CDVSMainPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (LOWORD(wParam) == IDC_OPEN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, NULL,
+ CFileDialog fd(TRUE, nullptr, nullptr,
OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,
_T(".idx .smi .sub .srt .psb .ssa .ass .usf|*.idx;*.smi;*.sub;*.srt;*.psb;*.ssa;*.ass;*.usf|")
_T("All files (*.*)|*.*||"),
@@ -403,7 +403,7 @@ void CDVSMainPPage::UpdateObjectData(bool fSave)
}
m_pDirectVobSub->get_SelectedLanguage(&m_iSelectedLanguage);
m_pDirectVobSub->get_Placement(&m_fOverridePlacement, &m_PlacementXperc, &m_PlacementYperc);
- m_pDirectVobSub->get_VobSubSettings(NULL, &m_fOnlyShowForcedVobSubs, NULL);
+ m_pDirectVobSub->get_VobSubSettings(nullptr, &m_fOnlyShowForcedVobSubs, nullptr);
m_pDirectVobSub->get_TextSettings(&m_defStyle);
m_pDirectVobSub->get_AspectRatioSettings(&m_ePARCompensationType);
}
@@ -767,11 +767,11 @@ bool CDVSAboutPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
case BN_CLICKED: {
if (LOWORD(wParam) == IDC_HOMEPAGEBTN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_HOMEPAGE), NULL, NULL, SW_SHOWNORMAL);
+ ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_HOMEPAGE), nullptr, nullptr, SW_SHOWNORMAL);
return true;
} else if (LOWORD(wParam) == IDC_BUGREPORTBTN) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_EMAIL), NULL, NULL, SW_SHOWNORMAL);
+ ShellExecute(m_Dlg, _T("open"), ResStr(IDS_URL_EMAIL), nullptr, nullptr, SW_SHOWNORMAL);
return true;
}
}
@@ -959,7 +959,7 @@ void CDVSColorPPage::UpdateControlData(bool fSave)
m_preflist.ResetContent();
m_dynchglist.ResetContent();
- BYTE* pData = NULL;
+ BYTE* pData = nullptr;
UINT nSize;
if (!theApp.GetProfileBinary(ResStr(IDS_R_GENERAL), ResStr(IDS_RG_COLORFORMATS), &pData, &nSize)
@@ -1038,11 +1038,11 @@ bool CDVSPathsPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
BROWSEINFO bi;
bi.hwndOwner = m_Dlg;
- bi.pidlRoot = NULL;
+ bi.pidlRoot = nullptr;
bi.pszDisplayName = pathbuff;
bi.lpszTitle = _T("");
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_EDITBOX | BIF_VALIDATE | BIF_USENEWUI;
- bi.lpfn = NULL;
+ bi.lpfn = nullptr;
bi.lParam = 0;
bi.iImage = 0;
diff --git a/src/filters/transform/VSFilter/StyleEditorDialog.cpp b/src/filters/transform/VSFilter/StyleEditorDialog.cpp
index f22c17e00..a686c2b93 100644
--- a/src/filters/transform/VSFilter/StyleEditorDialog.cpp
+++ b/src/filters/transform/VSFilter/StyleEditorDialog.cpp
@@ -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.
*
@@ -36,7 +36,7 @@ END_MESSAGE_MAP()
// CStyleEditorDialog dialog
IMPLEMENT_DYNAMIC(CStyleEditorDialog, CDialog)
-CStyleEditorDialog::CStyleEditorDialog(CString title, STSStyle* pstss, CWnd* pParent /*=NULL*/)
+CStyleEditorDialog::CStyleEditorDialog(CString title, STSStyle* pstss, CWnd* pParent /*=nullptr*/)
: CDialog(CStyleEditorDialog::IDD, pParent)
, m_title(title)
, m_stss(*pstss)
diff --git a/src/filters/transform/VSFilter/Systray.cpp b/src/filters/transform/VSFilter/Systray.cpp
index bd9aa7e13..3b491158b 100644
--- a/src/filters/transform/VSFilter/Systray.cpp
+++ b/src/filters/transform/VSFilter/Systray.cpp
@@ -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.
*
@@ -251,7 +251,7 @@ LRESULT CSystrayWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam)
DWORD flags, group, prevgroup = (DWORD) - 1;
for (UINT i = 0; i < cStreams; i++) {
- WCHAR* pName = NULL;
+ WCHAR* pName = nullptr;
if (S_OK == pStreams[j]->Info(i, 0, &flags, 0, &group, &pName, 0, 0)) {
if (prevgroup != group && i > 1) {
@@ -324,14 +324,14 @@ DWORD CALLBACK SystrayThreadProc(void* pParam)
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CSystrayWindow wnd((SystrayIconData*)pParam);
- if (!wnd.CreateEx(0, AfxRegisterWndClass(0), _T("DVSWND"), WS_OVERLAPPED, CRect(0, 0, 0, 0), NULL, 0, NULL)) {
+ if (!wnd.CreateEx(0, AfxRegisterWndClass(0), _T("DVSWND"), WS_OVERLAPPED, CRect(0, 0, 0, 0), nullptr, 0, nullptr)) {
return (DWORD) - 1;
}
((SystrayIconData*)pParam)->hSystrayWnd = wnd.m_hWnd;
MSG msg;
- while (GetMessage(&msg, NULL/*wnd.m_hWnd*/, 0, 0)) {
+ while (GetMessage(&msg, nullptr/*wnd.m_hWnd*/, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -345,10 +345,10 @@ DWORD CALLBACK SystrayThreadProc(void* pParam)
static TCHAR* CallPPage(IFilterGraph* pGraph, int idx, HWND hWnd)
{
int i = 0;
- WCHAR* wstr = NULL;
+ WCHAR* wstr = nullptr;
CComPtr<IBaseFilter> pFilter;
CAUUID caGUID;
- caGUID.pElems = NULL;
+ caGUID.pElems = nullptr;
BeginEnumFilters(pGraph, pEF, pBF) {
CComQIPtr<ISpecifyPropertyPages> pSPS = pBF;
@@ -368,7 +368,7 @@ static TCHAR* CallPPage(IFilterGraph* pGraph, int idx, HWND hWnd)
}
EndEnumFilters;
- TCHAR* ret = NULL;
+ TCHAR* ret = nullptr;
if (pFilter) {
if (hWnd != INVALID_HANDLE_VALUE) {
diff --git a/src/filters/transform/VSFilter/VSFilter.cpp b/src/filters/transform/VSFilter/VSFilter.cpp
index d3ba6c3fe..edc7ab760 100644
--- a/src/filters/transform/VSFilter/VSFilter.cpp
+++ b/src/filters/transform/VSFilter/VSFilter.cpp
@@ -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.
*
@@ -105,9 +105,9 @@ const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
};
const AMOVIESETUP_PIN sudpPins[] = {
- {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesIn), sudPinTypesIn},
- {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, _countof(sudPinTypesOut), sudPinTypesOut},
- {L"Input2", TRUE, FALSE, FALSE, TRUE, &CLSID_NULL, NULL, _countof(sudPinTypesIn2), sudPinTypesIn2}
+ {L"Input", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn), sudPinTypesIn},
+ {L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, nullptr, _countof(sudPinTypesOut), sudPinTypesOut},
+ {L"Input2", TRUE, FALSE, FALSE, TRUE, &CLSID_NULL, nullptr, _countof(sudPinTypesIn2), sudPinTypesIn2}
};
/*const*/
@@ -117,8 +117,8 @@ AMOVIESETUP_FILTER sudFilter[] = {
};
CFactoryTemplate g_Templates[] = {
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDirectVobSubFilter>, NULL, &sudFilter[0]},
- {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDirectVobSubFilter2>, NULL, &sudFilter[1]},
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CDirectVobSubFilter>, nullptr, &sudFilter[0]},
+ {sudFilter[1].strName, sudFilter[1].clsID, CreateInstance<CDirectVobSubFilter2>, nullptr, &sudFilter[1]},
{L"DVSMainPPage", &__uuidof(CDVSMainPPage), CreateInstance<CDVSMainPPage>},
{L"DVSGeneralPPage", &__uuidof(CDVSGeneralPPage), CreateInstance<CDVSGeneralPPage>},
{L"DVSMiscPPage", &__uuidof(CDVSMiscPPage), CreateInstance<CDVSMiscPPage>},
diff --git a/src/filters/transform/VSFilter/csriapi.cpp b/src/filters/transform/VSFilter/csriapi.cpp
index 4189789fc..505663dbb 100644
--- a/src/filters/transform/VSFilter/csriapi.cpp
+++ b/src/filters/transform/VSFilter/csriapi.cpp
@@ -50,7 +50,7 @@ CSRIAPI csri_inst* csri_open_file(csri_rend* renderer, const char* filename, str
int namesize;
wchar_t* namebuf;
- namesize = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
+ namesize = MultiByteToWideChar(CP_UTF8, 0, filename, -1, nullptr, 0);
if (!namesize) {
return 0;
}
diff --git a/src/filters/transform/VSFilter/plugins.cpp b/src/filters/transform/VSFilter/plugins.cpp
index e8218dcc2..c193e0eab 100644
--- a/src/filters/transform/VSFilter/plugins.cpp
+++ b/src/filters/transform/VSFilter/plugins.cpp
@@ -84,7 +84,7 @@ namespace Plugin
HRESULT hr;
if (!(m_pSubPicQueue = DEBUG_NEW CSubPicQueueNoThread(pAllocator, &hr)) || FAILED(hr)) {
- m_pSubPicQueue = NULL;
+ m_pSubPicQueue = nullptr;
return false;
}
}
@@ -182,14 +182,14 @@ namespace Plugin
bool Open(CString fn) {
SetFileName(_T(""));
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
if (CVobSubFile* vsf = DEBUG_NEW CVobSubFile(&m_csSubLock)) {
m_pSubPicProvider = (ISubPicProvider*)vsf;
if (vsf->Open(CString(fn))) {
SetFileName(fn);
} else {
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
}
}
@@ -216,7 +216,7 @@ namespace Plugin
bool Open(CString fn, int CharSet = DEFAULT_CHARSET) {
SetFileName(_T(""));
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
if (!m_pSubPicProvider) {
if (CRenderedTextSubtitle* rts = DEBUG_NEW CRenderedTextSubtitle(&m_csSubLock)) {
@@ -224,7 +224,7 @@ namespace Plugin
if (rts->Open(CString(fn), CharSet)) {
SetFileName(fn);
} else {
- m_pSubPicProvider = NULL;
+ m_pSubPicProvider = nullptr;
}
}
}
@@ -282,7 +282,7 @@ namespace Plugin
int ConfigProc(FilterActivation* fa, const FilterFunctions* ff, HWND hwnd) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
_T("VobSub files (*.idx;*.sub)|*.idx;*.sub||"), CWnd::FromHandle(hwnd), 0);
if (fd.DoModal() != IDOK) {
@@ -314,7 +314,7 @@ namespace Plugin
AFX_MANAGE_STATE(AfxGetStaticModuleState());
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
formats, CWnd::FromHandle(hwnd), sizeof(OPENFILENAME));
UINT_PTR CALLBACK OpenHookProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
@@ -420,19 +420,19 @@ namespace Plugin
ScriptFunctionDef vobsub_func_defs[] = {
{ (ScriptFunctionPtr)vobsubScriptConfig, "Config", "0s" },
- { NULL },
+ { nullptr },
};
CScriptObject vobsub_obj = {
- NULL, vobsub_func_defs
+ nullptr, vobsub_func_defs
};
struct FilterDefinition filterDef_vobsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"VobSub", // name
"Adds subtitles from a vob sequence.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
vobsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -440,27 +440,27 @@ namespace Plugin
baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&vobsub_obj, // script_obj
baseFssProc, // fssProc
};
ScriptFunctionDef textsub_func_defs[] = {
{ (ScriptFunctionPtr)textsubScriptConfig, "Config", "0si" },
- { NULL },
+ { nullptr },
};
CScriptObject textsub_obj = {
- NULL, textsub_func_defs
+ nullptr, textsub_func_defs
};
struct FilterDefinition filterDef_textsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"TextSub", // name
"Adds subtitles from srt, sub, psb, smi, ssa, ass file formats.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
textsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -468,8 +468,8 @@ namespace Plugin
baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&textsub_obj, // script_obj
baseFssProc, // fssProc
};
@@ -549,7 +549,7 @@ namespace Plugin
int ConfigProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff, VDXHWND hwnd) {
AFX_MANAGE_STATE(AfxGetStaticModuleState());
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY,
_T("VobSub files (*.idx;*.sub)|*.idx;*.sub||"), CWnd::FromHandle((HWND)hwnd), 0);
if (fd.DoModal() != IDOK) {
@@ -583,7 +583,7 @@ namespace Plugin
/* off encoding changing */
#ifndef _DEBUG
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK,
formats, CWnd::FromHandle((HWND)hwnd), sizeof(OPENFILENAME));
UINT_PTR CALLBACK OpenHookProc(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
@@ -593,7 +593,7 @@ namespace Plugin
fd.m_pOFN->lCustData = (LPARAM)DEFAULT_CHARSET;
#else
const TCHAR formats[] = _T("TextSub files (*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt)|*.sub;*.srt;*.smi;*.ssa;*.ass;*.xss;*.psb;*.txt||");
- CFileDialog fd(TRUE, NULL, GetFileName(), OFN_ENABLESIZING | OFN_HIDEREADONLY,
+ CFileDialog fd(TRUE, nullptr, GetFileName(), OFN_ENABLESIZING | OFN_HIDEREADONLY,
formats, CWnd::FromHandle((HWND)hwnd), sizeof(OPENFILENAME));
#endif
if (fd.DoModal() != IDOK) {
@@ -621,12 +621,12 @@ namespace Plugin
int vobsubInitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
{
- return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CVobSubVirtualDubFilter()) == NULL);
+ return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CVobSubVirtualDubFilter()) == nullptr);
}
int textsubInitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
{
- return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CTextSubVirtualDubFilter()) == NULL);
+ return ((*(CVirtualDubFilter**)fa->filter_data = DEBUG_NEW CTextSubVirtualDubFilter()) == nullptr);
}
void baseDeinitProc(VDXFilterActivation* fa, const VDXFilterFunctions* ff)
@@ -691,19 +691,19 @@ namespace Plugin
VDXScriptFunctionDef vobsub_func_defs[] = {
{ (VDXScriptFunctionPtr)vobsubScriptConfig, "Config", "0s" },
- { NULL },
+ { nullptr },
};
VDXScriptObject vobsub_obj = {
- NULL, vobsub_func_defs
+ nullptr, vobsub_func_defs
};
struct VDXFilterDefinition filterDef_vobsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"VobSub", // name
"Adds subtitles from a vob sequence.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
vobsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -711,27 +711,27 @@ namespace Plugin
baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&vobsub_obj, // script_obj
baseFssProc, // fssProc
};
VDXScriptFunctionDef textsub_func_defs[] = {
{ (VDXScriptFunctionPtr)textsubScriptConfig, "Config", "0si" },
- { NULL },
+ { nullptr },
};
VDXScriptObject textsub_obj = {
- NULL, textsub_func_defs
+ nullptr, textsub_func_defs
};
struct VDXFilterDefinition filterDef_textsub = {
- NULL, NULL, NULL, // next, prev, module
+ nullptr, nullptr, nullptr, // next, prev, module
"TextSub", // name
"Adds subtitles from srt, sub, psb, smi, ssa, ass file formats.", // desc
"Gabest", // maker
- NULL, // private_data
+ nullptr, // private_data
sizeof(CVirtualDubFilter**), // inst_data_size
textsubInitProc, // initProc
baseDeinitProc, // deinitProc
@@ -739,8 +739,8 @@ namespace Plugin
baseParamProc, // paramProc
baseConfigProc, // configProc
baseStringProc, // stringProc
- NULL, // startProc
- NULL, // endProc
+ nullptr, // startProc
+ nullptr, // endProc
&textsub_obj, // script_obj
baseFssProc, // fssProc
};
@@ -750,8 +750,8 @@ namespace Plugin
extern "C" __declspec(dllexport) int __cdecl VirtualdubFilterModuleInit2(VDXFilterModule* fm, const VDXFilterFunctions* ff, int& vdfd_ver, int& vdfd_compat)
{
- if (((fd_vobsub = ff->addFilter(fm, &filterDef_vobsub, sizeof(VDXFilterDefinition))) == NULL)
- || ((fd_textsub = ff->addFilter(fm, &filterDef_textsub, sizeof(VDXFilterDefinition))) == NULL)) {
+ if (((fd_vobsub = ff->addFilter(fm, &filterDef_vobsub, sizeof(VDXFilterDefinition))) == nullptr)
+ || ((fd_textsub = ff->addFilter(fm, &filterDef_textsub, sizeof(VDXFilterDefinition))) == nullptr)) {
return 1;
}
@@ -881,7 +881,7 @@ namespace Plugin
env->AddFunction("TextSub", "csif", TextSubCreateSIF, 0);
env->AddFunction("MaskSub", "siifi", MaskSubCreateSIIFI, 0);
env->SetVar(env->SaveString("RGBA"), false);
- return NULL;
+ return nullptr;
}
}
@@ -1039,7 +1039,7 @@ namespace Plugin
env->AddFunction("TextSubSwapUV", "b", TextSubSwapUV, 0);
env->AddFunction("MaskSub", "[file]s[width]i[height]i[fps]f[length]i[charset]i[vfr]s", MaskSubCreate, 0);
env->SetVar(env->SaveString("RGBA"), false);
- return NULL;
+ return nullptr;
}
}