diff options
-rw-r--r-- | src/DSUtil/DSUtil.h | 79 | ||||
-rw-r--r-- | src/Subtitles/DVBSub.cpp | 9 | ||||
-rw-r--r-- | src/Subtitles/USFSubtitles.cpp | 23 | ||||
-rw-r--r-- | src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp | 9 | ||||
-rw-r--r-- | src/filters/parser/MatroskaSplitter/MatroskaFile.cpp | 3 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitter.cpp | 11 | ||||
-rw-r--r-- | src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp | 12 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h | 3 |
8 files changed, 64 insertions, 85 deletions
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h index 48618bf92..495d0273c 100644 --- a/src/DSUtil/DSUtil.h +++ b/src/DSUtil/DSUtil.h @@ -170,62 +170,53 @@ public: }
};
-#define BeginEnumFilters(pFilterGraph, pEnumFilters, pBaseFilter) \
-{ \
- CComPtr<IEnumFilters> pEnumFilters; \
- if (pFilterGraph && SUCCEEDED(pFilterGraph->EnumFilters(&pEnumFilters))) \
- { \
- for (CComPtr<IBaseFilter> pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) \
- {
+#define BeginEnumFilters(pFilterGraph, pEnumFilters, pBaseFilter) \
+{ \
+ CComPtr<IEnumFilters> pEnumFilters; \
+ if (pFilterGraph && SUCCEEDED(pFilterGraph->EnumFilters(&pEnumFilters))) { \
+ for (CComPtr<IBaseFilter> pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) {
#define EndEnumFilters }}}
-#define BeginEnumCachedFilters(pGraphConfig, pEnumFilters, pBaseFilter) \
-{ \
- CComPtr<IEnumFilters> pEnumFilters; \
- if (pGraphConfig && SUCCEEDED(pGraphConfig->EnumCacheFilter(&pEnumFilters))) \
- { \
- for (CComPtr<IBaseFilter> pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) \
- {
+#define BeginEnumCachedFilters(pGraphConfig, pEnumFilters, pBaseFilter) \
+{ \
+ CComPtr<IEnumFilters> pEnumFilters; \
+ if (pGraphConfig && SUCCEEDED(pGraphConfig->EnumCacheFilter(&pEnumFilters))) { \
+ for (CComPtr<IBaseFilter> pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) {
#define EndEnumCachedFilters }}}
-#define BeginEnumPins(pBaseFilter, pEnumPins, pPin) \
-{ \
- CComPtr<IEnumPins> pEnumPins; \
- if (pBaseFilter && SUCCEEDED(pBaseFilter->EnumPins(&pEnumPins))) \
- { \
- for (CComPtr<IPin> pPin; S_OK == pEnumPins->Next(1, &pPin, 0); pPin = NULL) \
- {
+#define BeginEnumPins(pBaseFilter, pEnumPins, pPin) \
+{ \
+ CComPtr<IEnumPins> pEnumPins; \
+ if (pBaseFilter && SUCCEEDED(pBaseFilter->EnumPins(&pEnumPins))) { \
+ for (CComPtr<IPin> pPin; S_OK == pEnumPins->Next(1, &pPin, 0); pPin = NULL) {
#define EndEnumPins }}}
-#define BeginEnumMediaTypes(pPin, pEnumMediaTypes, pMediaType) \
-{ \
- CComPtr<IEnumMediaTypes> pEnumMediaTypes; \
- if (pPin && SUCCEEDED(pPin->EnumMediaTypes(&pEnumMediaTypes))) \
- { \
- AM_MEDIA_TYPE* pMediaType = NULL; \
- for (; S_OK == pEnumMediaTypes->Next(1, &pMediaType, NULL); DeleteMediaType(pMediaType), pMediaType = NULL) \
- {
+#define BeginEnumMediaTypes(pPin, pEnumMediaTypes, pMediaType) \
+{ \
+ CComPtr<IEnumMediaTypes> pEnumMediaTypes; \
+ if (pPin && SUCCEEDED(pPin->EnumMediaTypes(&pEnumMediaTypes))) { \
+ AM_MEDIA_TYPE* pMediaType = NULL; \
+ for (; S_OK == pEnumMediaTypes->Next(1, &pMediaType, NULL); DeleteMediaType(pMediaType), pMediaType = NULL) {
-#define EndEnumMediaTypes(pMediaType) \
- } \
- if (pMediaType) \
- DeleteMediaType(pMediaType); \
- } \
+#define EndEnumMediaTypes(pMediaType) \
+ } \
+ if (pMediaType) { \
+ DeleteMediaType(pMediaType); \
+ } \
+ } \
}
-#define BeginEnumSysDev(clsid, pMoniker) \
-{ \
- CComPtr<ICreateDevEnum> pDevEnum4$##clsid; \
- pDevEnum4$##clsid.CoCreateInstance(CLSID_SystemDeviceEnum); \
- CComPtr<IEnumMoniker> pClassEnum4$##clsid; \
- if (SUCCEEDED(pDevEnum4$##clsid->CreateClassEnumerator(clsid, &pClassEnum4$##clsid, 0)) \
- && pClassEnum4$##clsid) \
- { \
- for (CComPtr<IMoniker> pMoniker; pClassEnum4$##clsid->Next(1, &pMoniker, 0) == S_OK; pMoniker = NULL) \
- {
+#define BeginEnumSysDev(clsid, pMoniker) \
+{ \
+ CComPtr<ICreateDevEnum> pDevEnum4$##clsid; \
+ pDevEnum4$##clsid.CoCreateInstance(CLSID_SystemDeviceEnum); \
+ CComPtr<IEnumMoniker> pClassEnum4$##clsid; \
+ if (SUCCEEDED(pDevEnum4$##clsid->CreateClassEnumerator(clsid, &pClassEnum4$##clsid, 0)) \
+ && pClassEnum4$##clsid) { \
+ for (CComPtr<IMoniker> pMoniker; pClassEnum4$##clsid->Next(1, &pMoniker, 0) == S_OK; pMoniker = NULL) {
#define EndEnumSysDev }}}
diff --git a/src/Subtitles/DVBSub.cpp b/src/Subtitles/DVBSub.cpp index b109252e2..f756b516f 100644 --- a/src/Subtitles/DVBSub.cpp +++ b/src/Subtitles/DVBSub.cpp @@ -140,11 +140,10 @@ HRESULT CDVBSub::AddToBuffer(BYTE* pData, int nSize) return S_FALSE;
}
-#define MARKER \
- if (gb.BitRead(1) != 1) \
- { \
- ASSERT(0); \
- return E_FAIL; \
+#define MARKER \
+ if (gb.BitRead(1) != 1) { \
+ ASSERT(0); \
+ return E_FAIL; \
}
HRESULT CDVBSub::ParseSample(IMediaSample* pSample)
diff --git a/src/Subtitles/USFSubtitles.cpp b/src/Subtitles/USFSubtitles.cpp index 979ed4339..f48375f8b 100644 --- a/src/Subtitles/USFSubtitles.cpp +++ b/src/Subtitles/USFSubtitles.cpp @@ -30,22 +30,19 @@ CComVariant val; \
pNode->get_nodeValue(&val);
-#define BeginEnumAttribs(pNode, pChild) \
- { \
- CComPtr<IXMLDOMNamedNodeMap> pAttribs; \
- if (SUCCEEDED(pNode->get_attributes(&pAttribs)) && pAttribs != nullptr) \
- { \
- CComPtr<IXMLDOMNode> pChild; \
- for (pAttribs->nextNode(&pChild); pChild; pChild = nullptr, pAttribs->nextNode(&pChild)) \
- {
+#define BeginEnumAttribs(pNode, pChild) \
+ { \
+ CComPtr<IXMLDOMNamedNodeMap> pAttribs; \
+ if (SUCCEEDED(pNode->get_attributes(&pAttribs)) && pAttribs != nullptr) { \
+ CComPtr<IXMLDOMNode> pChild; \
+ for (pAttribs->nextNode(&pChild); pChild; pChild = nullptr, pAttribs->nextNode(&pChild)) {
#define EndEnumAttribs }}}
-#define BeginEnumChildren(pNode, pChild) \
- { \
- CComPtr<IXMLDOMNode> pChild, pNext; \
- for (pNode->get_firstChild(&pChild); pChild; pNext = nullptr, pChild->get_nextSibling(&pNext), pChild = pNext) \
- {
+#define BeginEnumChildren(pNode, pChild) \
+ { \
+ CComPtr<IXMLDOMNode> pChild, pNext; \
+ for (pNode->get_firstChild(&pChild); pChild; pNext = nullptr, pChild->get_nextSibling(&pNext), pChild = pNext) {
#define EndEnumChildren }}
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp index 99f7f3bfb..784e2614c 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp @@ -61,11 +61,10 @@ bool CBaseSplitterFileEx::NextMpegStartCode(BYTE& code, __int64 len) //
-#define MARKER \
- if (BitRead(1) != 1) \
- { \
- ASSERT(0); \
- return false; \
+#define MARKER \
+ if (BitRead(1) != 1) { \
+ ASSERT(0); \
+ return false; \
}
bool CBaseSplitterFileEx::Read(pshdr& h)
diff --git a/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp b/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp index d1458114b..396d6a449 100644 --- a/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp +++ b/src/filters/parser/MatroskaSplitter/MatroskaFile.cpp @@ -43,8 +43,7 @@ using namespace MatroskaReader; #define EndChunk \
} \
- } \
- while (pMN->Next()); \
+ } while (pMN->Next()); \
\
return S_OK;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index baa1357a1..1f301e345 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -1585,12 +1585,11 @@ HRESULT CMpegSplitterOutputPin::DeliverEndFlush() return __super::DeliverEndFlush();
}
-#define MOVE_TO_H264_START_CODE(b, e) \
- while (b <= e-4 && !((*(DWORD *)b == 0x01000000) || ((*(DWORD *)b & 0x00FFFFFF) == 0x00010000))) \
- { \
- b++; \
- } \
- if ((b <= e-4) && *(DWORD *)b == 0x01000000) \
+#define MOVE_TO_H264_START_CODE(b, e) \
+ while (b <= e-4 && !((*(DWORD *)b == 0x01000000) || ((*(DWORD *)b & 0x00FFFFFF) == 0x00010000))) { \
+ b++; \
+ } \
+ if ((b <= e-4) && *(DWORD *)b == 0x01000000) \
b++;
HRESULT CMpegSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
diff --git a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp index 678d9a54a..21f10db03 100644 --- a/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp +++ b/src/filters/switcher/AudioSwitcher/StreamSwitcher.cpp @@ -89,14 +89,12 @@ HRESULT GetPeer(CStreamSwitcherFilter* pFilter, T** ppT) #define CallPeerSeekingAll(call) \
HRESULT hr = E_NOTIMPL; \
POSITION pos = m_pFilter->m_pInputs.GetHeadPosition(); \
- while (pos) \
- { \
+ while (pos) { \
CBasePin* pPin = m_pFilter->m_pInputs.GetNext(pos); \
CComPtr<IPin> pConnected; \
if (FAILED(pPin->ConnectedTo(&pConnected))) \
continue; \
- if (CComQIPtr<IMediaSeeking> pMS = pConnected) \
- { \
+ if (CComQIPtr<IMediaSeeking> pMS = pConnected) { \
HRESULT hr2 = pMS->call; \
if (pPin == m_pFilter->GetInputPin()) \
hr = hr2; \
@@ -107,14 +105,12 @@ HRESULT GetPeer(CStreamSwitcherFilter* pFilter, T** ppT) #define CallPeerAll(call) \
HRESULT hr = E_NOTIMPL; \
POSITION pos = m_pFilter->m_pInputs.GetHeadPosition(); \
- while (pos) \
- { \
+ while (pos) { \
CBasePin* pPin = m_pFilter->m_pInputs.GetNext(pos); \
CComPtr<IPin> pConnected; \
if (FAILED(pPin->ConnectedTo(&pConnected))) \
continue; \
- if (CComQIPtr<IMediaPosition> pMP = pConnected) \
- { \
+ if (CComQIPtr<IMediaPosition> pMP = pConnected) { \
HRESULT hr2 = pMP->call; \
if (pPin == m_pFilter->GetInputPin()) \
hr = hr2; \
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h index e6e09831c..9784bd999 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.h @@ -49,8 +49,7 @@ #define CHECK_HR_TRACE(x) \
hr = ##x; \
- if (FAILED(hr)) \
- { \
+ if (FAILED(hr)) { \
TRACE(_T("Error : 0x%08x\n"), hr); \
ASSERT(hr == VFW_E_NOT_COMMITTED); \
return hr; \
|