Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2011 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a5edb86fa26c14f0b0b4 to your computer and use it in GitHub Desktop.
Save anonymous/a5edb86fa26c14f0b0b4 to your computer and use it in GitHub Desktop.
Index: src/apps/mplayerc/GoToDlg.cpp
===================================================================
--- src/apps/mplayerc/GoToDlg.cpp (revision 3580)
+++ src/apps/mplayerc/GoToDlg.cpp (working copy)
@@ -148,13 +148,13 @@
{
UpdateData();
- int frame = 0;
float fps = 0;
CAtlRegExp<> re;
REParseError status = re.Parse(_T("{\\z}[^0-9\\.]+{[0-9\\.]+}"), FALSE);
if (REPARSE_ERROR_OK == status) {
+ int frame = 0;
CAtlREMatchContext<> mc;
const CAtlREMatchContext<>::RECHAR* s = m_framestr.GetBuffer();
const CAtlREMatchContext<>::RECHAR* e = NULL;
Index: src/apps/mplayerc/Mpeg2SectionData.cpp
===================================================================
--- src/apps/mplayerc/Mpeg2SectionData.cpp (revision 3580)
+++ src/apps/mplayerc/Mpeg2SectionData.cpp (working copy)
@@ -222,14 +222,12 @@
// program_association_section()
CheckNoLog (ParseSIHeader (gb, SI_PAT, wSectionLength, wTSID));
while (gb.GetSize() - gb.GetPos() > 4) {
- WORD program_number;
- WORD program_map_PID = 0;
-
- program_number = gb.BitRead(16); // program_number
+ WORD program_number = gb.BitRead(16); // program_number
gb.BitRead(3); // reserved
if (program_number==0) {
gb.BitRead(13); // network_PID
} else {
+ WORD program_map_PID = 0;
program_map_PID = gb.BitRead(13); // program_map_PID
if (Channels.Lookup(program_number)) {
Channels [program_number].SetPMT (program_map_PID);
Index: src/apps/mplayerc/PlayerNavigationDialog.cpp
===================================================================
--- src/apps/mplayerc/PlayerNavigationDialog.cpp (revision 3580)
+++ src/apps/mplayerc/PlayerNavigationDialog.cpp (working copy)
@@ -145,11 +145,10 @@
void CPlayerNavigationDialog::UpdateElementList()
{
- int nItem;
- int nCurrentChannel;
AppSettings& s = AfxGetAppSettings();
if (s.iDefaultCaptureDevice == 1) {
+ int nCurrentChannel;
m_ChannelList.ResetContent();
nCurrentChannel = s.nDVBLastChannel;
@@ -159,7 +158,7 @@
CDVBChannel& Channel = s.m_DVBChannels.GetNext(pos);
if ((m_bTVStations && (Channel.GetVideoPID() != 0)) ||
(!m_bTVStations && (Channel.GetAudioCount() > 0)) && (Channel.GetVideoPID() == 0)) {
- nItem = m_ChannelList.AddString (Channel.GetName());
+ int nItem = m_ChannelList.AddString (Channel.GetName());
if (nItem < MAX_CHANNELS_ALLOWED) {
p_nItems [nItem] = Channel.GetPrefNumber();
}
Index: src/apps/mplayerc/PPageFormats.cpp
===================================================================
--- src/apps/mplayerc/PPageFormats.cpp (revision 3580)
+++ src/apps/mplayerc/PPageFormats.cpp (working copy)
@@ -909,9 +909,10 @@
CMediaFormatCategory& mfc = AfxGetAppSettings().m_Formats[m_list.GetItemData(pItem->iItem)];
CAtlList<CString> sl;
- int nSel = -1;
if (pItem->iSubItem == COL_ENGINE) {
+ int nSel = -1;
+
sl.AddTail(_T("DirectShow"));
sl.AddTail(_T("RealMedia"));
sl.AddTail(_T("QuickTime"));
Index: src/apps/mplayerc/TunerScanDlg.cpp
===================================================================
--- src/apps/mplayerc/TunerScanDlg.cpp (revision 3580)
+++ src/apps/mplayerc/TunerScanDlg.cpp (working copy)
@@ -188,11 +188,11 @@
{
CDVBChannel Channel;
CString strTemp;
- int nItem;
- int nChannelNumber;
Channel.FromString ((LPCTSTR) lParam);
if (!m_bIgnoreEncryptedChannels || !Channel.IsEncrypted()) {
+ int nItem, nChannelNumber;
+
if (Channel.GetOriginNumber() != 0) { // LCN is available
nChannelNumber = Channel.GetOriginNumber();
// Insert new channel so that channels are sorted by their logical number
Index: src/filters/parser/MpegSplitter/MpegSplitter.cpp
===================================================================
--- src/filters/parser/MpegSplitter/MpegSplitter.cpp (revision 3580)
+++ src/filters/parser/MpegSplitter/MpegSplitter.cpp (working copy)
@@ -805,12 +805,12 @@
CStringW name = CMpegSplitterFile::CStreamList::ToString(i);
CStringW str;
- int iProgram = -1;
if (i == CMpegSplitterFile::subpic && s.pid == NO_SUBTITLE_PID) {
str = NO_SUBTITLE_NAME;
continue;
} else {
+ int iProgram = -1;
const CHdmvClipInfo::Stream *pClipInfo;
const CMpegSplitterFile::program * pProgram = m_pFile->FindProgram(s.pid, iProgram, pClipInfo);
const wchar_t *pStreamName = NULL;
@@ -891,11 +891,11 @@
CStringW name = CMpegSplitterFile::CStreamList::ToString(i);
CStringW str;
- int iProgram = -1;
if (i == CMpegSplitterFile::subpic && s.pid == NO_SUBTITLE_PID) {
str = NO_SUBTITLE_NAME;
} else {
+ int iProgram = -1;
const CHdmvClipInfo::Stream *pClipInfo;
const CMpegSplitterFile::program * pProgram = m_pFile->FindProgram(s.pid, iProgram, pClipInfo);
const wchar_t *pStreamName = NULL;
Index: src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp
===================================================================
--- src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp (revision 3580)
+++ src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp (working copy)
@@ -879,7 +879,7 @@
m_segments.rtStart = p->rtStart;
while(pIn - pInOrg < len) {
- BYTE hdr = *pIn++, subseq = 0, seqnum = 0;
+ BYTE hdr = *pIn++;
DWORD packetlen = 0, packetoffset = 0;
if((hdr&0xc0) == 0x40) {
@@ -887,9 +887,11 @@
packetlen = len - (pIn - pInOrg);
} else {
if((hdr&0x40) == 0) {
+ BYTE subseq = 0;
subseq = (*pIn++)&0x7f;
}
+ BYTE seqnum = 0;
#define GetWORD(var) \
var = (var<<8)|(*pIn++); \
var = (var<<8)|(*pIn++); \
Index: src/filters/PinInfoWnd.cpp
===================================================================
--- src/filters/PinInfoWnd.cpp (revision 3580)
+++ src/filters/PinInfoWnd.cpp (working copy)
@@ -219,9 +219,8 @@
str = _T("- Not connected\n\n");
}
- int iMT = 0;
-
BeginEnumMediaTypes(pPin, pEMT, pmt) {
+ int iMT = 0;
CMediaTypeEx mt(*pmt);
str.Format(_T("- Enumerated media type %d:\n\n"), iMT++);
Index: src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp
===================================================================
--- src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp (revision 3580)
+++ src/filters/renderer/MpcAudioRenderer/MpcAudioRenderer.cpp (working copy)
@@ -352,7 +352,6 @@
if (! pmt) {
return E_POINTER;
}
- int size = 0;
TRACE(_T("CMpcAudioRenderer::SetMediaType\n"));
if (m_useWASAPI) {
@@ -372,7 +371,8 @@
WAVEFORMATEX *pwf = (WAVEFORMATEX *) pmt->Format();
if (pwf!=NULL) {
- size = sizeof(WAVEFORMATEX) + pwf->cbSize;
+ int size = 0;
+ size = sizeof(WAVEFORMATEX) + pwf->cbSize;
m_pWaveFileFormat = (WAVEFORMATEX *)new BYTE[size];
if (! m_pWaveFileFormat) {
Index: src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
===================================================================
--- src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp (revision 3580)
+++ src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp (working copy)
@@ -2100,18 +2100,22 @@
int nFree = 0;
int nAlloc = 0;
int nSubPic = 0;
- REFERENCE_TIME QueueNow = 0;
REFERENCE_TIME QueueStart = 0;
REFERENCE_TIME QueueEnd = 0;
+
if (m_pSubPicQueue) {
+ REFERENCE_TIME QueueNow = 0;
m_pSubPicQueue->GetStats(nSubPic, QueueNow, QueueStart, QueueEnd);
+
if (QueueStart) {
QueueStart -= QueueNow;
}
+
if (QueueEnd) {
QueueEnd -= QueueNow;
}
}
+
pAlloc->GetStats(nFree, nAlloc);
strText.Format(L"Subtitles : Free %d Allocated %d Buffered %d QueueStart %7.3f QueueEnd %7.3f", nFree, nAlloc, nSubPic, (double(QueueStart)/10000000.0), (double(QueueEnd)/10000000.0));
DrawText(rc, strText, 1);
Index: src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
===================================================================
--- src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp (revision 3580)
+++ src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp (working copy)
@@ -544,10 +544,10 @@
{
float fMaxRate = FLT_MAX; // Default.
UINT32 fpsNumerator = 0, fpsDenominator = 0;
- UINT MonitorRateHz = 0;
if (!bThin && (m_pMediaType != NULL)) {
// Non-thinned: Use the frame rate and monitor refresh rate.
+ UINT MonitorRateHz = 0;
// Frame rate:
MFGetAttributeRatio(m_pMediaType, MF_MT_FRAME_RATE,
@@ -558,8 +558,7 @@
if (fpsDenominator && fpsNumerator && MonitorRateHz) {
// Max Rate = Refresh Rate / Frame Rate
- fMaxRate = (float)MulDiv(
- MonitorRateHz, fpsDenominator, fpsNumerator);
+ fMaxRate = (float)MulDiv(MonitorRateHz, fpsDenominator, fpsNumerator);
}
}
return fMaxRate;
Index: src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp
===================================================================
--- src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp (revision 3580)
+++ src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp (working copy)
@@ -226,10 +226,11 @@
hr = m_pOutput->GetConnected()->QueryAccept(&mt);
ASSERT(SUCCEEDED(hr)); // should better not fail, after all "mt" is the current media type, just with a different resolution
- HRESULT hr1 = 0, hr2 = 0;
+ HRESULT hr1 = 0;
CComPtr<IMediaSample> pOut;
if(SUCCEEDED(hr1 = m_pOutput->GetConnected()->ReceiveConnection(m_pOutput, &mt))) {
if (bSendSample) {
+ HRESULT hr2 = 0;
if (SUCCEEDED(hr2 = m_pOutput->GetDeliveryBuffer(&pOut, NULL, NULL, 0))) {
AM_MEDIA_TYPE* pmt;
if(SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
Index: src/filters/transform/MPCVideoDec/FfmpegContext.c
===================================================================
--- src/filters/transform/MPCVideoDec/FfmpegContext.c (revision 3580)
+++ src/filters/transform/MPCVideoDec/FfmpegContext.c (working copy)
@@ -158,7 +158,6 @@
int no_level51_support = 1;
int too_much_ref_frames = 0;
int profile_higher_than_high = 0;
- int max_ref_frames = 0;
int max_ref_frames_dpb41 = min(11, 8388608/(nWidth * nHeight) );
if (pBuffer != NULL) {
@@ -169,10 +168,12 @@
cur_pps = pContext->pps_buffers[0];
if (cur_sps != NULL) {
+ int max_ref_frames = 0;
+
if(cur_sps->bit_depth_luma > 8) {
return DXVA_HIGH_BIT;
}
-
+
video_is_level51 = cur_sps->level_idc >= 51 ? 1 : 0;
profile_higher_than_high = (cur_sps->profile_idc > 100);
max_ref_frames = max_ref_frames_dpb41; // default value is calculate
Index: src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
===================================================================
--- src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp (revision 3580)
+++ src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp (working copy)
@@ -1027,10 +1027,10 @@
HRESULT CMPCVideoDecFilter::SetMediaType(PIN_DIRECTION direction,const CMediaType *pmt)
{
- int nNewCodec;
+ if (direction == PINDIR_INPUT) {
- if (direction == PINDIR_INPUT) {
- nNewCodec = FindCodec(pmt);
+ int nNewCodec = FindCodec(pmt);
+
if (nNewCodec == -1) {
return VFW_E_TYPE_NOT_ACCEPTED;
}
Index: src/filters/transform/VSFilter/Systray.cpp
===================================================================
--- src/filters/transform/VSFilter/Systray.cpp (revision 3580)
+++ src/filters/transform/VSFilter/Systray.cpp (working copy)
@@ -407,7 +407,6 @@
// hWnd == INVALID_HANDLE_VALUE - get name, hWnd != INVALID_HANDLE_VALUE - show ppage
static TCHAR* CallPPage(IFilterGraph* pGraph, int idx, HWND hWnd)
{
- int i = 0;
bool fFound = false;
WCHAR* wstr = NULL;
@@ -416,7 +415,9 @@
caGUID.pElems = NULL;
BeginEnumFilters(pGraph, pEF, pBF) {
+ int i = 0;
CComQIPtr<ISpecifyPropertyPages> pSPS = pBF;
+
if(!pSPS) {
continue;
}
Index: src/SubPic/MemSubPic.cpp
===================================================================
--- src/SubPic/MemSubPic.cpp (revision 3580)
+++ src/SubPic/MemSubPic.cpp (working copy)
@@ -316,7 +316,7 @@
#ifndef _WIN64
void AlphaBlt_YUY2_MMX(int w, int h, BYTE* d, int dstpitch, BYTE* s, int srcpitch)
{
- unsigned int ia, c;
+ unsigned int ia;
DWORD* d2 = (DWORD*)d;
BYTE* s2 = s;
@@ -328,7 +328,7 @@
for(; s2 < s2end; s2 += 8, d2++) {
ia = (s2[3]+s2[7])>>1;
if(ia < 0xff) {
- c = (s2[4]<<24)|(s2[5]<<16)|(s2[0]<<8)|s2[1]; // (v<<24)|(y2<<16)|(u<<8)|y1;
+ unsigned int c = (s2[4]<<24)|(s2[5]<<16)|(s2[0]<<8)|s2[1]; // (v<<24)|(y2<<16)|(u<<8)|y1;
ia = (ia<<24)|(s2[7]<<16)|(ia<<8)|s2[3];
__asm {
mov esi, s2
@@ -357,7 +357,7 @@
void AlphaBlt_YUY2_C(int w, int h, BYTE* d, int dstpitch, BYTE* s, int srcpitch)
{
- unsigned int ia, c;
+ unsigned int ia;
DWORD* d2 = (DWORD*)d;
BYTE* s2 = s;
@@ -368,7 +368,7 @@
for(; s2 < s2end; s2 += 8, d2++) {
ia = (s2[3]+s2[7])>>1;
if(ia < 0xff) {
- c = (s2[4]<<24)|(s2[5]<<16)|(s2[0]<<8)|s2[1]; // (v<<24)|(y2<<16)|(u<<8)|y1;
+ unsigned int c = (s2[4]<<24)|(s2[5]<<16)|(s2[0]<<8)|s2[1]; // (v<<24)|(y2<<16)|(u<<8)|y1;
// YUY2 colorspace fix. rewrited from sse2 asm
DWORD y1 = (DWORD)(((((*d2&0xff)-0x10)*(s2[3]>>1))>>7)+s2[1])&0xff; // y1
Index: src/SubPic/SubPicQueueImpl.cpp
===================================================================
--- src/SubPic/SubPicQueueImpl.cpp (revision 3580)
+++ src/SubPic/SubPicQueueImpl.cpp (working copy)
@@ -330,7 +330,6 @@
m_rtQueueMin = 0x7fffffffffffffffi64;
m_rtQueueMax = 0xffffffffffffffffi64;
- REFERENCE_TIME rtBestStop = 0x7fffffffffffffffi64;
POSITION SavePos = 0;
{
POSITION Iter = m_Queue.GetHeadPosition();
@@ -341,6 +340,7 @@
REFERENCE_TIME rtStop = pSubPic->GetStop();
REFERENCE_TIME rtSegmentStop = pSubPic->GetSegmentStop();
if(rtNow >= rtStart && rtNow < rtSegmentStop) {
+ REFERENCE_TIME rtBestStop = 0x7fffffffffffffffi64;
REFERENCE_TIME Diff = rtNow - rtStop;
if (Diff < rtBestStop) {
rtBestStop = Diff;
Index: src/Subtitles/libssf/Glyph.cpp
===================================================================
--- src/Subtitles/libssf/Glyph.cpp (revision 3580)
+++ src/Subtitles/libssf/Glyph.cpp (working copy)
@@ -169,7 +169,7 @@
CPoint p = path.points[i];
if(bscale) {
- float x, y, z, xx, yy, zz;
+ float x, y, z;
x = sx * (p.x - org.x);
y = sy * (p.y - org.y);
@@ -204,6 +204,7 @@
}
if(brotate) {
+ float xx, yy, zz;
xx = x*caz + y*saz;
yy = -(x*saz - y*caz);
zz = z;
Index: src/Subtitles/RTS.cpp
===================================================================
--- src/Subtitles/RTS.cpp (revision 3580)
+++ src/Subtitles/RTS.cpp (working copy)
@@ -635,9 +635,8 @@
HFONT hOldFont = SelectFont(g_hDC, font);
- int width = 0;
-
if(m_style.fontSpacing || (long)GetVersion() < 0) {
+ int width = 0;
bool bFirstPath = true;
for(LPCWSTR s = m_str; *s; s++) {
Index: src/Subtitles/STS.cpp
===================================================================
--- src/Subtitles/STS.cpp (revision 3580)
+++ src/Subtitles/STS.cpp (working copy)
@@ -480,8 +480,6 @@
static bool OpenSubRipper(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet)
{
- int num = 0;
-
CStringW buff;
while(file->ReadString(buff)) {
buff.Trim();
@@ -490,6 +488,7 @@
}
WCHAR sep;
+ int num = 0;
int hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2;
int c = swscanf(buff, L"%d%c%d%c%d%c%d --> %d%c%d%c%d%c%d\n",
&hh1, &sep, &mm1, &sep, &ss1, &sep, &ms1,
@@ -1717,12 +1716,12 @@
static bool OpenXombieSub(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet)
{
- float version = 0;
-
// CMapStringToPtr stylemap;
CStringW buff;
while(file->ReadString(buff)) {
+ float version = 0;
+
buff.Trim();
if(buff.IsEmpty() || buff.GetAt(0) == ';') {
continue;
@@ -2274,8 +2273,6 @@
void CSimpleTextSubtitle::AddStyle(CString name, STSStyle* style)
{
- int i, j;
-
if(name.IsEmpty()) {
name = _T("Default");
}
@@ -2287,6 +2284,7 @@
return;
}
+ int i, j;
int len = name.GetLength();
for(i = len; i > 0 && _istdigit(name[i-1]); i--) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment