diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-05-11 11:48:32 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2013-05-11 16:27:21 +0400 |
commit | 087937b441de4d69632d5f27b82bbca67e3ba2fc (patch) | |
tree | 0b56dd984390c201f6ca6181e158616cec648460 /src | |
parent | 4283988f7f96fb909a58284dbc169f7bcdf014ab (diff) |
cosmetics
Diffstat (limited to 'src')
-rw-r--r-- | src/filters/transform/MPCVideoDec/DXVADecoder.cpp | 39 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp | 2 | ||||
-rw-r--r-- | src/mpc-hc/AppSettings.h | 8 | ||||
-rw-r--r-- | src/mpc-hc/Mpeg2SectionData.cpp | 45 | ||||
-rw-r--r-- | src/mpc-hc/SubtitleDlDlg.cpp | 9 | ||||
-rw-r--r-- | src/mpc-hc/mplayerc.h | 2 |
6 files changed, 61 insertions, 44 deletions
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp index 3b343921b..4265075d2 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp @@ -31,16 +31,19 @@ #include "FfmpegContext.h"
#define MAX_RETRY_ON_PENDING 50
-#define DO_DXVA_PENDING_LOOP(x) \
- nTry = 0; \
- while (FAILED(hr = x) && nTry < MAX_RETRY_ON_PENDING) \
- { \
- if (hr != E_PENDING) break; \
- Sleep(3); \
- nTry++; \
+#define DO_DXVA_PENDING_LOOP(x) \
+ nTry = 0; \
+ while (FAILED(hr = x) && nTry < MAX_RETRY_ON_PENDING) { \
+ if (hr != E_PENDING) \
+ break; \
+ Sleep(3); \
+ nTry++; \
}
-CDXVADecoder::CDXVADecoder(CMPCVideoDecFilter* pFilter, IAMVideoAccelerator* pAMVideoAccelerator, DXVAMode nMode, int nPicEntryNumber)
+CDXVADecoder::CDXVADecoder(CMPCVideoDecFilter* pFilter,
+ IAMVideoAccelerator* pAMVideoAccelerator,
+ DXVAMode nMode,
+ int nPicEntryNumber)
{
m_nEngine = ENGINE_DXVA1;
m_pAMVideoAccelerator = pAMVideoAccelerator;
@@ -50,7 +53,11 @@ CDXVADecoder::CDXVADecoder(CMPCVideoDecFilter* pFilter, IAMVideoAccelerator* pAM Init(pFilter, nMode, nPicEntryNumber);
}
-CDXVADecoder::CDXVADecoder(CMPCVideoDecFilter* pFilter, IDirectXVideoDecoder* pDirectXVideoDec, DXVAMode nMode, int nPicEntryNumber, DXVA2_ConfigPictureDecode* pDXVA2Config)
+CDXVADecoder::CDXVADecoder(CMPCVideoDecFilter* pFilter,
+ IDirectXVideoDecoder* pDirectXVideoDec,
+ DXVAMode nMode,
+ int nPicEntryNumber,
+ DXVA2_ConfigPictureDecode* pDXVA2Config)
{
m_nEngine = ENGINE_DXVA2;
m_pDirectXVideoDec = pDirectXVideoDec;
@@ -484,9 +491,15 @@ HRESULT CDXVADecoder::EndFrame(int nSurfaceIndex) }
// === Picture store functions
-bool CDXVADecoder::AddToStore(int nSurfaceIndex, IMediaSample* pSample, bool bRefPicture,
- REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, bool bIsField,
- FF_FIELD_TYPE nFieldType, FF_SLICE_TYPE nSliceType, int nCodecSpecific)
+bool CDXVADecoder::AddToStore(int nSurfaceIndex,
+ IMediaSample* pSample,
+ bool bRefPicture,
+ REFERENCE_TIME rtStart,
+ REFERENCE_TIME rtStop,
+ bool bIsField,
+ FF_FIELD_TYPE nFieldType,
+ FF_SLICE_TYPE nSliceType,
+ int nCodecSpecific)
{
if (bIsField && (m_nFieldSurface == -1)) {
m_nFieldSurface = nSurfaceIndex;
@@ -736,7 +749,7 @@ BYTE CDXVADecoder::GetConfigIntraResidUnsigned() void CDXVADecoder::EndOfStream()
{
- CComPtr<IMediaSample> pSampleToDeliver;
+ CComPtr<IMediaSample> pSampleToDeliver;
for (int nPicIndex = 0; nPicIndex < m_nPicEntryNumber; nPicIndex++) {
PICTURE_STORE& pic = m_pPictureStore[nPicIndex];
diff --git a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp index 1d450ae1f..61d5fcc91 100644 --- a/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp +++ b/src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp @@ -94,7 +94,7 @@ STDMETHODIMP_(int) CDXVA2Sample::GetDXSurfaceId() return m_dwSurfaceId;
}
-CVideoDecDXVAAllocator::CVideoDecDXVAAllocator(CMPCVideoDecFilter* pVideoDecFilter, HRESULT* phr)
+CVideoDecDXVAAllocator::CVideoDecDXVAAllocator(CMPCVideoDecFilter* pVideoDecFilter, HRESULT* phr)
: CBaseAllocator(NAME("CVideoDecDXVAAllocator"), nullptr, phr)
, m_pVideoDecFilter(pVideoDecFilter)
, m_ppRTSurfaceArray(nullptr)
diff --git a/src/mpc-hc/AppSettings.h b/src/mpc-hc/AppSettings.h index c40b1806d..05218f7c7 100644 --- a/src/mpc-hc/AppSettings.h +++ b/src/mpc-hc/AppSettings.h @@ -128,11 +128,11 @@ enum MCE_RAW_INPUT { MCE_MEDIA_PREVIOUSTRACK = 0x0100B6
};
-#define AUDRNDT_NULL_COMP _T("Null Audio Renderer (Any)")
-#define AUDRNDT_NULL_UNCOMP _T("Null Audio Renderer (Uncompressed)")
-#define AUDRNDT_MPC _T("MPC Audio Renderer")
+#define AUDRNDT_NULL_COMP _T("Null Audio Renderer (Any)")
+#define AUDRNDT_NULL_UNCOMP _T("Null Audio Renderer (Uncompressed)")
+#define AUDRNDT_MPC _T("MPC Audio Renderer")
-#define DEFAULT_SUBTITLE_PATHS _T(".;.\\subtitles;.\\subs")
+#define DEFAULT_SUBTITLE_PATHS _T(".;.\\subtitles;.\\subs")
#define DEFAULT_JUMPDISTANCE_1 1000
#define DEFAULT_JUMPDISTANCE_2 5000
#define DEFAULT_JUMPDISTANCE_3 20000
diff --git a/src/mpc-hc/Mpeg2SectionData.cpp b/src/mpc-hc/Mpeg2SectionData.cpp index 8f750326c..92af75c3e 100644 --- a/src/mpc-hc/Mpeg2SectionData.cpp +++ b/src/mpc-hc/Mpeg2SectionData.cpp @@ -26,18 +26,17 @@ #include "Mpeg2SectionData.h"
-#define BeginEnumDescriptors(gb, nType, nLength) \
-{ \
- BYTE DescBuffer[256]; \
- int nLimit = ((int)gb.BitRead(12)) + gb.GetPos(); \
- while (gb.GetPos() < nLimit) \
- { \
- MPEG2_DESCRIPTOR nType = (MPEG2_DESCRIPTOR)gb.BitRead(8); \
+#define BeginEnumDescriptors(gb, nType, nLength) \
+{ \
+ BYTE DescBuffer[256]; \
+ int nLimit = (int)gb.BitRead(12) + gb.GetPos(); \
+ while (gb.GetPos() < nLimit) { \
+ MPEG2_DESCRIPTOR nType = (MPEG2_DESCRIPTOR)gb.BitRead(8); \
WORD nLength = (WORD)gb.BitRead(8);
-#define SkipDescriptor(gb, nType, nLength) \
- gb.ReadBuffer(DescBuffer, nLength); \
- TRACE(_T("Skipped descriptor : 0x%02x\n"), nType); \
+#define SkipDescriptor(gb, nType, nLength) \
+ gb.ReadBuffer(DescBuffer, nLength); \
+ TRACE(_T("Skipped descriptor : 0x%02x\n"), nType); \
UNREFERENCED_PARAMETER(nType);
#define EndEnumDescriptors }}
@@ -135,7 +134,7 @@ CStringW CMpeg2DataParser::ConvertString(BYTE* pBuffer, size_t uLength) cp = codepages[0];
}
- // Workaround a bug in MS MultiByteToWideChar with ISO/IEC 6937 and take care of the Euro symbol special case (step 1/2)...
+ // Work around a bug in MS MultiByteToWideChar with ISO/IEC 6937 and take care of the Euro symbol special case (step 1/2)...
CArray<size_t> euroSymbolPos;
if (cp == 20269) {
BYTE tmp;
@@ -160,7 +159,7 @@ CStringW CMpeg2DataParser::ConvertString(BYTE* pBuffer, size_t uLength) LPWSTR strResultBuff = strResult.GetBuffer(nDestSize);
MultiByteToWideChar(cp, MB_PRECOMPOSED, (LPCSTR)pBuffer, (int)uLength, strResultBuff, nDestSize);
- // Workaround a bug in MS MultiByteToWideChar with ISO/IEC 6937 and take care of the Euro symbol special case (step 2/2)...
+ // Work around a bug in MS MultiByteToWideChar with ISO/IEC 6937 and take care of the Euro symbol special case (step 2/2)...
if (cp == 20269) {
for (size_t i = 0, len = (size_t)nDestSize; i < len; i++) {
switch (strResultBuff[i]) {
@@ -326,7 +325,7 @@ HRESULT CMpeg2DataParser::ParsePAT() WORD program_number = (WORD)gb.BitRead(16); // program_number
gb.BitRead(3); // reserved
if (program_number == 0) {
- gb.BitRead(13); // network_PID
+ gb.BitRead(13); // network_PID
} else {
WORD program_map_PID = (WORD)gb.BitRead(13); // program_map_PID
if (Channels.Lookup(program_number)) {
@@ -548,41 +547,41 @@ HRESULT CMpeg2DataParser::ParseEIT(ULONG ulSID, EventDescriptor& NowNext) BeginEnumDescriptors(gb, nType, nLength) {
switch (nType) {
case DT_SHORT_EVENT:
- gb.BitRead(24); // ISO_639_language_code
+ gb.BitRead(24); // ISO_639_language_code
- nLen = (UINT8)gb.BitRead(8); // event_name_length
+ nLen = (UINT8)gb.BitRead(8); // event_name_length
gb.ReadBuffer(DescBuffer, nLen);
NowNext.eventName = ConvertString(DescBuffer, nLen);
- nLen = (UINT8)gb.BitRead(8); // text_length
+ nLen = (UINT8)gb.BitRead(8); // text_length
gb.ReadBuffer(DescBuffer, nLen);
NowNext.eventDesc = ConvertString(DescBuffer, nLen);
break;
case DT_EXTENDED_EVENT:
descriptorNumber = (UINT8)gb.BitRead(4); // descriptor_number
- gb.BitRead(4); // last_descriptor_number
- gb.BitRead(24); // ISO_639_language_code
+ gb.BitRead(4); // last_descriptor_number
+ gb.BitRead(24); // ISO_639_language_code
- itemsLength = (UINT8)gb.BitRead(8); // length_of_items
+ itemsLength = (UINT8)gb.BitRead(8); // length_of_items
while (itemsLength > 0) {
- nLen = (UINT8)gb.BitRead(8); // item_description_length
+ nLen = (UINT8)gb.BitRead(8); // item_description_length
gb.ReadBuffer(DescBuffer, nLen);
itemDesc = ConvertString(DescBuffer, nLen);
NowNext.extendedDescriptorsItemsDesc.Add(itemDesc);
itemsLength -= nLen + 1;
- nLen = (UINT8)gb.BitRead(8); // item_length
+ nLen = (UINT8)gb.BitRead(8); // item_length
gb.ReadBuffer(DescBuffer, nLen);
itemText = ConvertString(DescBuffer, nLen);
NowNext.extendedDescriptorsItemsContent.Add(itemText);
itemsLength -= nLen + 1;
}
- nLen = (UINT8)gb.BitRead(8); // text_length
+ nLen = (UINT8)gb.BitRead(8); // text_length
if (nLen > 0) {
gb.ReadBuffer(DescBuffer, nLen);
text = ConvertString(DescBuffer, nLen);
- if (descriptorNumber == 0) { // new descriptor set
+ if (descriptorNumber == 0) { // new descriptor set
NowNext.extendedDescriptorsTexts.AddTail(text);
} else {
NowNext.extendedDescriptorsTexts.GetTail().Append(text);
diff --git a/src/mpc-hc/SubtitleDlDlg.cpp b/src/mpc-hc/SubtitleDlDlg.cpp index 6065d0108..3d9031677 100644 --- a/src/mpc-hc/SubtitleDlDlg.cpp +++ b/src/mpc-hc/SubtitleDlDlg.cpp @@ -53,7 +53,9 @@ void CSubtitleDlDlg::DoDataExchange(CDataExchange* pDX) size_t CSubtitleDlDlg::StrMatch(LPCTSTR a, LPCTSTR b)
{
- size_t count = 0, alen = _tcslen(a), blen = _tcslen(b);
+ size_t count = 0;
+ size_t alen = _tcslen(a);
+ size_t blen = _tcslen(b);
for (size_t i = 0; i < alen && i < blen; i++) {
if (_totlower(a[i]) != _totlower(b[i])) {
@@ -111,7 +113,8 @@ CString CSubtitleDlDlg::LangCodeToName(LPCSTR code) int CALLBACK CSubtitleDlDlg::DefSortCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
PDEFPARAMSORT defps = reinterpret_cast<PDEFPARAMSORT>(lParamSort);
- TCHAR left[MAX_PATH] = _T(""), right[MAX_PATH] = _T("");
+ TCHAR left[MAX_PATH] = _T("");
+ TCHAR right[MAX_PATH] = _T("");
// sort by language first
ListView_GetItemText(defps->m_hWnd, lParam1, COL_LANGUAGE, left, sizeof(left));
@@ -141,12 +144,14 @@ int CALLBACK CSubtitleDlDlg::DefSortCompare(LPARAM lParam1, LPARAM lParam2, LPAR ListView_GetItemText(defps->m_hWnd, lParam2, COL_FILENAME, right, sizeof(right));
size_t lmatch = StrMatch(defps->m_filename, left);
size_t rmatch = StrMatch(defps->m_filename, right);
+
// sort by matching character number
if (lmatch > rmatch) {
return -1;
} else if (lmatch < rmatch) {
return 1;
}
+
// prefer shorter names
size_t llen = _tcslen(left);
size_t rlen = _tcslen(right);
diff --git a/src/mpc-hc/mplayerc.h b/src/mpc-hc/mplayerc.h index 14bcea718..40ae15658 100644 --- a/src/mpc-hc/mplayerc.h +++ b/src/mpc-hc/mplayerc.h @@ -203,5 +203,5 @@ public: afx_msg void OnHelpShowcommandlineswitches();
};
-#define AfxGetMyApp() static_cast<CMPlayerCApp*>(AfxGetApp())
#define AfxGetAppSettings() static_cast<CMPlayerCApp*>(AfxGetApp())->m_s
+#define AfxGetMyApp() static_cast<CMPlayerCApp*>(AfxGetApp())
|