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:
-rw-r--r--src/DSUtil/MediaTypeEx.cpp4
-rw-r--r--src/DeCSS/DeCSSInputPin.cpp4
-rw-r--r--src/DeCSS/VobFile.cpp7
-rw-r--r--src/SubPic/MemSubPic.cpp10
-rw-r--r--src/Subtitles/RTS.cpp8
-rw-r--r--src/Subtitles/Rasterizer.cpp8
-rw-r--r--src/Subtitles/STS.cpp14
-rw-r--r--src/Subtitles/USFSubtitles.cpp4
-rw-r--r--src/Subtitles/VobSubFile.cpp21
-rw-r--r--src/Subtitles/VobSubFile.h2
-rw-r--r--src/Subtitles/VobSubFileRipper.cpp10
-rw-r--r--src/Subtitles/VobSubImage.cpp8
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp6
-rw-r--r--src/filters/muxer/DSMMuxer/DSMMuxer.cpp4
-rw-r--r--src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp2
-rw-r--r--src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp4
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp16
-rw-r--r--src/filters/transform/VSFilter/Copy.cpp6
-rw-r--r--src/filters/transform/VSFilter/DirectVobSub.cpp10
-rw-r--r--src/filters/transform/VSFilter/StyleEditorDialog.cpp5
-rw-r--r--src/mpc-hc/DebugShadersDlg.cpp4
-rw-r--r--src/mpc-hc/DropTarget.h2
-rw-r--r--src/mpc-hc/PPageAccelTbl.cpp5
-rw-r--r--src/mpc-hc/PPageAudioSwitcher.cpp4
-rw-r--r--src/mpc-hc/PPageOutput.cpp4
-rw-r--r--src/mpc-hc/PPageSubStyle.cpp5
-rw-r--r--src/mpc-hc/QuicktimeGraph.cpp4
-rw-r--r--src/mpc-hc/mplayerc.cpp2
28 files changed, 95 insertions, 88 deletions
diff --git a/src/DSUtil/MediaTypeEx.cpp b/src/DSUtil/MediaTypeEx.cpp
index d9cde419d..6fa348df7 100644
--- a/src/DSUtil/MediaTypeEx.cpp
+++ b/src/DSUtil/MediaTypeEx.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -262,7 +262,7 @@ CString CMediaTypeEx::GetVideoCodecName(const GUID& subtype, DWORD biCompression
for (ptrdiff_t i = 0; i < 4; i++) {
if (b[i] >= 'a' && b[i] <= 'z') {
- b[i] = toupper(b[i]);
+ b[i] = (BYTE)toupper(b[i]);
}
}
diff --git a/src/DeCSS/DeCSSInputPin.cpp b/src/DeCSS/DeCSSInputPin.cpp
index c76ef19a1..41f78df16 100644
--- a/src/DeCSS/DeCSSInputPin.cpp
+++ b/src/DeCSS/DeCSSInputPin.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2013 see Authors.txt
+ * (C) 2006-2013, 2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -289,7 +289,7 @@ STDMETHODIMP CDeCSSInputPin::Get(REFGUID PropSet, ULONG Id, LPVOID pInstanceData
switch (Id) {
case AM_PROPERTY_DVDCOPY_CHLG_KEY: { // 1. auth: send our nonce word
AM_DVDCOPY_CHLGKEY* pChlgKey = (AM_DVDCOPY_CHLGKEY*)pPropertyData;
- for (int i = 0; i < 10; i++) {
+ for (BYTE i = 0; i < 10; i++) {
pChlgKey->ChlgKey[i] = 9 - (m_Challenge[i] = i);
}
*pBytesReturned = sizeof(AM_DVDCOPY_CHLGKEY);
diff --git a/src/DeCSS/VobFile.cpp b/src/DeCSS/VobFile.cpp
index 417614202..8a8ef473e 100644
--- a/src/DeCSS/VobFile.cpp
+++ b/src/DeCSS/VobFile.cpp
@@ -97,7 +97,7 @@ bool CDVDSession::Authenticate()
BYTE Challenge[10], Key[10];
- for (int i = 0; i < 10; i++) {
+ for (BYTE i = 0; i < 10; i++) {
Challenge[i] = i;
}
@@ -553,7 +553,7 @@ bool CVobFile::Open(CString fn, CAtlList<CString>& vobs, ULONG nProgNum /*= 1*/,
int cellTableOffset = ReadShort();
REFERENCE_TIME rtDuration = 0;
m_pChapters[0] = 0;
- for (int currentProgram = 0; currentProgram < programChainPrograms; currentProgram++) {
+ for (BYTE currentProgram = 0; currentProgram < programChainPrograms; currentProgram++) {
m_ifoFile.Seek(pcgITPosition + chainOffset + programMapOffset + currentProgram, CFile::begin);
byte entryCell = ReadByte();
byte exitCell = entryCell;
@@ -854,6 +854,7 @@ BSTR CVobFile::GetTrackName(UINT aTrackIdx) const
REFERENCE_TIME CVobFile::GetChapterOffset(UINT ChapterNumber) const
{
REFERENCE_TIME rtChapterOffset = 0;
- m_pChapters.Lookup(ChapterNumber, rtChapterOffset);
+ ASSERT(ChapterNumber < BYTE_MAX);
+ m_pChapters.Lookup((BYTE)ChapterNumber, rtChapterOffset);
return rtChapterOffset;
}
diff --git a/src/SubPic/MemSubPic.cpp b/src/SubPic/MemSubPic.cpp
index 19be4c12b..c8b7c253d 100644
--- a/src/SubPic/MemSubPic.cpp
+++ b/src/SubPic/MemSubPic.cpp
@@ -62,7 +62,7 @@ void ColorConvInit()
for (int i = 0; i < 256; i++) {
clipBase[i] = 0;
- clipBase[i + 256] = i;
+ clipBase[i + 256] = BYTE(i);
clipBase[i + 512] = 255;
}
@@ -269,8 +269,8 @@ STDMETHODIMP CMemSubPic::Unlock(RECT* pDirtyRect)
BYTE* e = s + w * 4;
for (; s < e; s += 8) { // ARGB ARGB -> AxYU AxYV
if ((s[3] + s[7]) < 0x1fe) {
- s[1] = (c2y_yb[s[0]] + c2y_yg[s[1]] + c2y_yr[s[2]] + 0x108000) >> 16;
- s[5] = (c2y_yb[s[4]] + c2y_yg[s[5]] + c2y_yr[s[6]] + 0x108000) >> 16;
+ s[1] = BYTE((c2y_yb[s[0]] + c2y_yg[s[1]] + c2y_yr[s[2]] + 0x108000) >> 16);
+ s[5] = BYTE((c2y_yb[s[4]] + c2y_yg[s[5]] + c2y_yr[s[6]] + 0x108000) >> 16);
int scaled_y = (s[1] + s[5] - 32) * cy_cy2;
@@ -289,7 +289,7 @@ STDMETHODIMP CMemSubPic::Unlock(RECT* pDirtyRect)
for (; s < e; s += 4) { // ARGB -> AYUV
if (s[3] < 0xff) {
- int y = (c2y_yb[s[0]] + c2y_yg[s[1]] + c2y_yr[s[2]] + 0x108000) >> 16;
+ auto y = BYTE((c2y_yb[s[0]] + c2y_yg[s[1]] + c2y_yr[s[2]] + 0x108000) >> 16);
int scaled_y = (y - 32) * cy_cy;
s[1] = clip[((((s[0] << 16) - scaled_y) >> 10) * c2y_cu + 0x800000 + 0x8000) >> 16];
s[0] = clip[((((s[2] << 16) - scaled_y) >> 10) * c2y_cv + 0x800000 + 0x8000) >> 16];
@@ -615,7 +615,7 @@ STDMETHODIMP CMemSubPic::AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget)
for (; s2 < s2end; s2 += 8, d2++, is2 += 8) {
unsigned int ia = (s2[3] + s2[3 + src.pitch] + is2[3] + is2[3 + src.pitch]) >> 2;
if (ia < 0xff) {
- *d2 = (((*d2 - 0x80) * ia) >> 8) + ((s2[0] + s2[src.pitch]) >> 1);
+ *d2 = BYTE((((*d2 - 0x80) * ia) >> 8) + ((s2[0] + s2[src.pitch]) >> 1));
}
}
}
diff --git a/src/Subtitles/RTS.cpp b/src/Subtitles/RTS.cpp
index 284b1fcfe..e1e7a60e3 100644
--- a/src/Subtitles/RTS.cpp
+++ b/src/Subtitles/RTS.cpp
@@ -1333,7 +1333,7 @@ void CSubtitle::CreateClippers(CSize size)
int k = std::min(width, w);
for (ptrdiff_t i = 0; i < k; i++, a += da) {
- am[i] = (am[i] * a) >> 14;
+ am[i] = BYTE((am[i] * a) >> 14);
}
a = 0x40 << 8;
@@ -1345,7 +1345,7 @@ void CSubtitle::CreateClippers(CSize size)
}
for (ptrdiff_t i = k; i < w; i++, a -= da) {
- am[i] = (am[i] * a) >> 14;
+ am[i] = BYTE((am[i] * a) >> 14);
}
}
} else if (m_effects[EF_SCROLL] && m_effects[EF_SCROLL]->param[4]) {
@@ -1374,7 +1374,7 @@ void CSubtitle::CreateClippers(CSize size)
for (ptrdiff_t j = k; j < l; j++, a += da) {
for (ptrdiff_t i = 0; i < w; i++, am++) {
- *am = ((*am) * a) >> 14;
+ *am = BYTE(((*am) * a) >> 14);
}
}
}
@@ -1397,7 +1397,7 @@ void CSubtitle::CreateClippers(CSize size)
int j = k;
for (; j < l; j++, a += da) {
for (ptrdiff_t i = 0; i < w; i++, am++) {
- *am = ((*am) * a) >> 14;
+ *am = BYTE(((*am) * a) >> 14);
}
}
diff --git a/src/Subtitles/Rasterizer.cpp b/src/Subtitles/Rasterizer.cpp
index 4f68ceba5..3ac3a770c 100644
--- a/src/Subtitles/Rasterizer.cpp
+++ b/src/Subtitles/Rasterizer.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -865,9 +865,9 @@ bool Rasterizer::Rasterize(int xsub, int ysub, int fBlur, double fGaussianBlur)
byte* dst = buffer + m_pOverlayData->mOverlayPitch * (y >> 3) + first;
if (first == last) {
- *dst += x2 - x1;
+ *dst += byte(x2 - x1);
} else {
- *dst += ((first + 1) << 3) - x1;
+ *dst += byte(((first + 1) << 3) - x1);
++dst;
while (++first < last) {
@@ -875,7 +875,7 @@ bool Rasterizer::Rasterize(int xsub, int ysub, int fBlur, double fGaussianBlur)
++dst;
}
- *dst += x2 - (last << 3);
+ *dst += byte(x2 - (last << 3));
}
}
}
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp
index 0a2e200f9..8ec947531 100644
--- a/src/Subtitles/STS.cpp
+++ b/src/Subtitles/STS.cpp
@@ -1261,7 +1261,7 @@ static bool LoadFont(const CString& font)
const TCHAR* s = font;
const TCHAR* e = s + len;
for (BYTE* p = pData; s < e; s++, p++) {
- *p = *s - 33;
+ *p = BYTE(*s - 33);
}
for (ptrdiff_t i = 0, j = 0, k = len & ~3; i < k; i += 4, j += 3) {
@@ -1477,7 +1477,7 @@ static bool OpenSubStationAlpha(CTextFile* file, CSimpleTextSubtitle& ret, int C
style->colors[2] = style->colors[3]; // style->colors[2] is used for drawing the outline
alpha = std::max(std::min(alpha, 0xff), 0);
for (size_t i = 0; i < 3; i++) {
- style->alpha[i] = alpha;
+ style->alpha[i] = (BYTE)alpha;
}
style->alpha[3] = 0x80;
}
@@ -1639,7 +1639,7 @@ static bool OpenXombieSub(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet
style->colors[i] = (COLORREF)GetInt(pszBuff, nBuffLength);
}
for (size_t i = 0; i < 4; i++) {
- style->alpha[i] = GetInt(pszBuff, nBuffLength);
+ style->alpha[i] = (BYTE)GetInt(pszBuff, nBuffLength);
}
style->fontWeight = GetInt(pszBuff, nBuffLength) ? FW_BOLD : FW_NORMAL;
style->fItalic = GetInt(pszBuff, nBuffLength);
@@ -2609,7 +2609,7 @@ bool CSimpleTextSubtitle::Open(CString fn, int CharSet, CString name, CString vi
return Open(&f, CharSet, name);
}
-static size_t CountLines(CTextFile* f, ULONGLONG from, ULONGLONG to, CString& s = CString())
+static size_t CountLines(CTextFile* f, ULONGLONG from, ULONGLONG to, CString s = _T(""))
{
size_t n = 0;
f->Seek(from, CFile::begin);
@@ -3032,7 +3032,7 @@ STSStyle& STSStyle::operator = (LOGFONT& lf)
LOGFONTA& operator <<= (LOGFONTA& lfa, STSStyle& s)
{
- lfa.lfCharSet = s.charSet;
+ lfa.lfCharSet = (BYTE)s.charSet;
strncpy_s(lfa.lfFaceName, LF_FACESIZE, CStringA(s.fontName), _TRUNCATE);
HDC hDC = GetDC(nullptr);
lfa.lfHeight = -MulDiv((int)(s.fontSize + 0.5), GetDeviceCaps(hDC, LOGPIXELSY), 72);
@@ -3046,7 +3046,7 @@ LOGFONTA& operator <<= (LOGFONTA& lfa, STSStyle& s)
LOGFONTW& operator <<= (LOGFONTW& lfw, STSStyle& s)
{
- lfw.lfCharSet = s.charSet;
+ lfw.lfCharSet = (BYTE)s.charSet;
wcsncpy_s(lfw.lfFaceName, LF_FACESIZE, CStringW(s.fontName), _TRUNCATE);
HDC hDC = GetDC(nullptr);
lfw.lfHeight = -MulDiv((int)(s.fontSize + 0.5), GetDeviceCaps(hDC, LOGPIXELSY), 72);
@@ -3100,7 +3100,7 @@ STSStyle& operator <<= (STSStyle& s, const CString& style)
s.colors[i] = (COLORREF)GetInt(pszBuff, nBuffLength, L';');
}
for (size_t i = 0; i < 4; i++) {
- s.alpha[i] = GetInt(pszBuff, nBuffLength, L';');
+ s.alpha[i] = (BYTE)GetInt(pszBuff, nBuffLength, L';');
}
s.charSet = GetInt(pszBuff, nBuffLength, L';');
s.fontName = WToT(GetStrW(pszBuff, nBuffLength, L';'));
diff --git a/src/Subtitles/USFSubtitles.cpp b/src/Subtitles/USFSubtitles.cpp
index 4d610c1d5..737dad5e0 100644
--- a/src/Subtitles/USFSubtitles.cpp
+++ b/src/Subtitles/USFSubtitles.cpp
@@ -348,12 +348,12 @@ bool CUSFSubtitles::ConvertToSTS(CSimpleTextSubtitle& sts)
for (size_t i = 0; i < 4; i++) {
DWORD color = ColorToDWORD(s->fontstyle.color[i]);
- int alpha = (BYTE)wcstol(s->fontstyle.alpha, nullptr, 10);
+ auto alpha = (BYTE)wcstol(s->fontstyle.alpha, nullptr, 10);
stss->colors[i] = color & 0xffffff;
stss->alpha[i] = (BYTE)(color >> 24);
- stss->alpha[i] = stss->alpha[i] + (255 - stss->alpha[i]) * std::min(std::max(alpha, 0), 100) / 100;
+ stss->alpha[i] = BYTE(stss->alpha[i] + (255 - stss->alpha[i]) * std::min(std::max(alpha, 0ui8), 100ui8) / 100);
}
if (!s->fontstyle.face.IsEmpty()) {
diff --git a/src/Subtitles/VobSubFile.cpp b/src/Subtitles/VobSubFile.cpp
index 5aa0bf1d8..bf54b6e5f 100644
--- a/src/Subtitles/VobSubFile.cpp
+++ b/src/Subtitles/VobSubFile.cpp
@@ -648,7 +648,7 @@ bool CVobSubFile::ReadIdx(CString fn, int& ver)
} else if (entry == _T("id")) {
str.MakeLower();
- int langid = ((str[0] & 0xff) << 8) | (str[1] & 0xff);
+ WORD langid = ((str[0] & 0xff) << 8) | (str[1] & 0xff);
i = str.Find(_T("index:"));
if (i < 0) {
@@ -690,8 +690,8 @@ bool CVobSubFile::ReadIdx(CString fn, int& ver)
} else if (id >= 0 && entry == _T("timestamp")) {
SubPos sb;
- sb.vobid = vobid;
- sb.cellid = cellid;
+ sb.vobid = (char)vobid;
+ sb.cellid = (char)cellid;
sb.celltimestamp = celltimestamp;
sb.bValid = true;
@@ -1143,13 +1143,15 @@ BYTE* CVobSubFile::GetPacket(size_t idx, size_t& packetSize, size_t& dataSize, s
break;
}
+ ASSERT(nLang < BYTE_MAX);
+
// let's check a few things to make sure...
if (*(DWORD*)&buff[0x00] != 0xba010000
|| *(DWORD*)&buff[0x0e] != 0xbd010000
|| !(buff[0x15] & 0x80)
|| (buff[0x17] & 0xf0) != 0x20
|| (buff[buff[0x16] + 0x17] & 0xe0) != 0x20
- || (buff[buff[0x16] + 0x17] & 0x1f) != nLang) {
+ || (buff[buff[0x16] + 0x17] & 0x1f) != (BYTE)nLang) {
break;
}
@@ -1360,7 +1362,7 @@ STDMETHODIMP CVobSubFile::Render(SubPicDesc& spd, REFERENCE_TIME rt, double fps,
rt /= 10000;
- if (!GetFrame(GetFrameIdxByTimeStamp(rt), -1, rt)) {
+ if (!GetFrame(GetFrameIdxByTimeStamp(rt), SIZE_T_ERROR, rt)) {
return E_FAIL;
}
@@ -1496,8 +1498,8 @@ static void PixelAtBiLinear(RGBQUAD& c, int x, int y, CVobSubImage& src)
+ c21.rgbGreen * v2u1 + c22.rgbGreen * v2u2) >> 24;
c.rgbBlue = (c11.rgbBlue * v1u1 + c12.rgbBlue * v1u2
+ c21.rgbBlue * v2u1 + c22.rgbBlue * v2u2) >> 24;
- c.rgbReserved = (v1u1 + v1u2
- + v2u1 + v2u2) >> 16;
+ c.rgbReserved = BYTE((v1u1 + v1u2
+ + v2u1 + v2u2) >> 16);
}
static void StretchBlt(SubPicDesc& spd, CRect dstrect, CVobSubImage& src)
@@ -1960,7 +1962,8 @@ bool CVobSubFile::SaveScenarist(CString fn, int delay)
BYTE colormap[16];
for (size_t i = 0; i < 16; i++) {
- int idx = 0, maxdif = 255 * 255 * 3 + 1;
+ BYTE idx = 0;
+ int maxdif = 255 * 255 * 3 + 1;
for (size_t j = 0; j < 16 && maxdif; j++) {
int rdif = pal[j].rgbRed - m_orgpal[i].rgbRed;
@@ -1970,7 +1973,7 @@ bool CVobSubFile::SaveScenarist(CString fn, int delay)
int dif = rdif * rdif + gdif * gdif + bdif * bdif;
if (dif < maxdif) {
maxdif = dif;
- idx = (int)j;
+ idx = (BYTE)j;
}
}
diff --git a/src/Subtitles/VobSubFile.h b/src/Subtitles/VobSubFile.h
index 02c9c3369..b1aea10e1 100644
--- a/src/Subtitles/VobSubFile.h
+++ b/src/Subtitles/VobSubFile.h
@@ -94,7 +94,7 @@ public:
};
struct SubLang {
- int id = 0;
+ WORD id = 0;
CString name, alt;
CAtlArray<SubPos> subpos;
};
diff --git a/src/Subtitles/VobSubFileRipper.cpp b/src/Subtitles/VobSubFileRipper.cpp
index 031671dd4..9345fe45e 100644
--- a/src/Subtitles/VobSubFileRipper.cpp
+++ b/src/Subtitles/VobSubFileRipper.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -1024,23 +1024,21 @@ STDMETHODIMP CVobSubFileRipper::LoadParamFile(CString fn)
line.TrimLeft();
n = 0;
-
- int langnum;
-
if (_istdigit(lang[0])) {
+ int langnum;
n = _stscanf_s(lang, _T("%d"), &langnum);
if (n != 1) {
break;
}
- m_rd.selids[langnum] = true;
+ m_rd.selids[(BYTE)langnum] = true;
} else if (_istalpha(lang[0])) {
n = _stscanf_s(lang, _T("%s"), langid, _countof(langid));
if (n != 1) {
break;
}
- int id = (langid[0] << 8) + langid[1];
+ BYTE id = BYTE((langid[0] << 8) + langid[1]);
if (id == 'cc') {
m_rd.bClosedCaption = true;
diff --git a/src/Subtitles/VobSubImage.cpp b/src/Subtitles/VobSubImage.cpp
index f00fb2b4e..c797f40e5 100644
--- a/src/Subtitles/VobSubImage.cpp
+++ b/src/Subtitles/VobSubImage.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -990,8 +990,8 @@ void CVobSubImage::SplitOutline(const COutline& o, COutline& o1, COutline& o2)
}
}
- size_t maxlen = 0, maxidx = -1;
- size_t maxlen2 = 0, maxidx2 = -1;
+ size_t maxlen = 0, maxidx = SIZE_T_ERROR;
+ size_t maxlen2 = 0, maxidx2 = SIZE_T_ERROR;
for (i = 0; i < la.GetCount(); i++) {
if (maxlen < la[i]) {
@@ -1005,6 +1005,8 @@ void CVobSubImage::SplitOutline(const COutline& o, COutline& o1, COutline& o2)
}
}
+ ASSERT(maxidx != SIZE_T_ERROR && maxidx2 != SIZE_T_ERROR);
+
if (maxlen == maxlen2) {
maxidx = maxidx2; // if equal choose the inner section
}
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
index 6b38dd9e1..e4408028c 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-2013 see Authors.txt
+ * (C) 2006-2013, 2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -244,8 +244,8 @@ void CBaseMuxerRawOutputPin::MuxPacket(const CMediaType& mt, const MuxerPacket*
int len = (DataSize + 7) & 0x1fff;
BYTE hdr[7] = {0xff, 0xf9};
- hdr[2] = (profile << 6) | (srate_idx << 2) | ((channels & 4) >> 2);
- hdr[3] = ((channels & 3) << 6) | (len >> 11);
+ hdr[2] = BYTE((profile << 6) | (srate_idx << 2) | ((channels & 4) >> 2));
+ hdr[3] = BYTE(((channels & 3) << 6) | (len >> 11));
hdr[4] = (len >> 3) & 0xff;
hdr[5] = ((len & 7) << 5) | 0x1f;
hdr[6] = 0xfc;
diff --git a/src/filters/muxer/DSMMuxer/DSMMuxer.cpp b/src/filters/muxer/DSMMuxer/DSMMuxer.cpp
index 8c3584967..192c8484c 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-2013 see Authors.txt
+ * (C) 2006-2013, 2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -417,7 +417,7 @@ void CDSMMuxerFilter::IndexSyncPoint(const MuxerPacket* p, __int64 fp)
m_rtPrevSyncPoint = p->rtStart;
SyncPoint sp;
- sp.id = p->pPin->GetID();
+ sp.id = (BYTE)p->pPin->GetID();
sp.rtStart = p->rtStart;
sp.rtStop = p->pPin->IsSubtitleStream() ? p->rtStop : _I64_MAX;
sp.fp = fp;
diff --git a/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp b/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
index 9c1dc8f86..f2c1e0d82 100644
--- a/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
+++ b/src/filters/muxer/MatroskaMuxer/MatroskaFile.cpp
@@ -255,7 +255,7 @@ QWORD CLength::Size(bool fWithHeader)
QWORD len = 0;
for (int i = 1; i <= 8; i++) {
- if (!(m_len & (~((1i64 << (7 * i)) - 1))) && (m_len & ((1i64 << (7 * i)) - 1)) != ((1i64 << (7 * i)) - 1)) {
+ if (!(m_len & (~((QWORD(1) << (7 * i)) - 1))) && (m_len & ((QWORD(1) << (7 * i)) - 1)) != ((QWORD(1) << (7 * i)) - 1)) {
len += i;
break;
}
diff --git a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
index f03d8c0c4..c5be29d31 100644
--- a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
+++ b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp
@@ -156,7 +156,7 @@ CBasePin* CMatroskaMuxerFilter::GetPin(int n)
}
}
- if (n == m_pInputs.GetCount() && m_pOutput) {
+ if (n == (int)m_pInputs.GetCount() && m_pOutput) {
return m_pOutput;
}
@@ -1105,7 +1105,7 @@ HRESULT CMatroskaMuxerInputPin::CompleteConnect(IPin* pPin)
*dst++ = 2;
for (int i = 0; i < 2; i++) {
for (int len2 = pvf2->HeaderSize[i]; len2 >= 0; len2 -= 255) {
- *dst++ = std::min(len2, 255);
+ *dst++ = (BYTE)std::min(len2, BYTE_MAX);
}
}
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
index bead020d2..4f4704c6d 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
@@ -1365,22 +1365,22 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
return E_FAIL;
}
- unsigned short* lut3DOutput = nullptr;
- unsigned short* lut3DInput = nullptr;
+ uint16_t* lut3DOutput = nullptr;
+ uint16_t* lut3DInput = nullptr;
try {
// Create the 3D LUT input
- lut3DOutput = DEBUG_NEW unsigned short[m_Lut3DEntryCount * 3];
- lut3DInput = DEBUG_NEW unsigned short[m_Lut3DEntryCount * 3];
+ lut3DOutput = DEBUG_NEW uint16_t[m_Lut3DEntryCount * 3];
+ lut3DInput = DEBUG_NEW uint16_t[m_Lut3DEntryCount * 3];
- unsigned short* lut3DInputIterator = lut3DInput;
+ uint16_t* lut3DInputIterator = lut3DInput;
for (int b = 0; b < m_Lut3DSize; b++) {
for (int g = 0; g < m_Lut3DSize; g++) {
for (int r = 0; r < m_Lut3DSize; r++) {
- *lut3DInputIterator++ = r * 65535 / (m_Lut3DSize - 1);
- *lut3DInputIterator++ = g * 65535 / (m_Lut3DSize - 1);
- *lut3DInputIterator++ = b * 65535 / (m_Lut3DSize - 1);
+ *lut3DInputIterator++ = uint16_t(r * 65535 / (m_Lut3DSize - 1));
+ *lut3DInputIterator++ = uint16_t(g * 65535 / (m_Lut3DSize - 1));
+ *lut3DInputIterator++ = uint16_t(b * 65535 / (m_Lut3DSize - 1));
}
}
}
diff --git a/src/filters/transform/VSFilter/Copy.cpp b/src/filters/transform/VSFilter/Copy.cpp
index 3d9293b0e..b6c65e0d8 100644
--- a/src/filters/transform/VSFilter/Copy.cpp
+++ b/src/filters/transform/VSFilter/Copy.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -44,7 +44,7 @@ void BltLineRGB32(DWORD* d, BYTE* sub, int w, const GUID& subtype)
for (; db < dbtend; sub += 4, db++) {
if (sub[3] < 0xff) {
int y = (c2y_yb[sub[0]] + c2y_yg[sub[1]] + c2y_yr[sub[2]] + 0x108000) >> 16;
- *db = y; // w/o colors
+ *db = BYTE(y); // w/o colors
}
}
} else if (subtype == MEDIASUBTYPE_YUY2) {
@@ -54,7 +54,7 @@ void BltLineRGB32(DWORD* d, BYTE* sub, int w, const GUID& subtype)
for (; ds < dstend; sub += 4, ds++) {
if (sub[3] < 0xff) {
int y = (c2y_yb[sub[0]] + c2y_yg[sub[1]] + c2y_yr[sub[2]] + 0x108000) >> 16;
- *ds = 0x8000 | y; // w/o colors
+ *ds = WORD(0x8000 | y); // w/o colors
}
}
} else if (subtype == MEDIASUBTYPE_RGB555) {
diff --git a/src/filters/transform/VSFilter/DirectVobSub.cpp b/src/filters/transform/VSFilter/DirectVobSub.cpp
index e9fb9ead8..f8cdc9b1c 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-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -300,12 +300,12 @@ STDMETHODIMP CDirectVobSub::get_TextSettings(void* lf, int lflen, COLORREF* colo
return E_INVALIDARG;
}
- ((LOGFONT*)lf)->lfCharSet = m_defStyle.charSet;
- ((LOGFONT*)lf)->lfItalic = m_defStyle.fItalic;
+ ((LOGFONT*)lf)->lfCharSet = (BYTE)m_defStyle.charSet;
+ ((LOGFONT*)lf)->lfItalic = (BYTE)m_defStyle.fItalic;
((LOGFONT*)lf)->lfHeight = (LONG)m_defStyle.fontSize;
((LOGFONT*)lf)->lfWeight = m_defStyle.fontWeight;
- ((LOGFONT*)lf)->lfStrikeOut = m_defStyle.fStrikeOut;
- ((LOGFONT*)lf)->lfUnderline = m_defStyle.fUnderline;
+ ((LOGFONT*)lf)->lfStrikeOut = (BYTE)m_defStyle.fStrikeOut;
+ ((LOGFONT*)lf)->lfUnderline = (BYTE)m_defStyle.fUnderline;
}
if (color) {
diff --git a/src/filters/transform/VSFilter/StyleEditorDialog.cpp b/src/filters/transform/VSFilter/StyleEditorDialog.cpp
index 806e6cff5..3e4e47734 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-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -193,7 +193,8 @@ void CStyleEditorDialog::OnOK()
m_stss.marginRect = m_margin;
for (size_t i = 0; i < m_alpha.size(); i++) {
- m_stss.alpha[i] = BYTE_MAX - m_alpha[i];
+ ASSERT(m_alpha[i] <= BYTE_MAX);
+ m_stss.alpha[i] = BYTE_MAX - BYTE(m_alpha[i]);
}
__super::OnOK();
diff --git a/src/mpc-hc/DebugShadersDlg.cpp b/src/mpc-hc/DebugShadersDlg.cpp
index bfd94d1c6..3adb9007a 100644
--- a/src/mpc-hc/DebugShadersDlg.cpp
+++ b/src/mpc-hc/DebugShadersDlg.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2013-2014 see Authors.txt
+ * (C) 2013-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -64,7 +64,7 @@ CDebugShadersDlg::CDebugShadersDlg()
SetSizeGripVisibility(FALSE);
SetMinTrackSize(CSize(360, 100));
AddAnchor(IDC_COMBO1, TOP_LEFT, TOP_RIGHT);
- AddAnchor(IDC_STATIC, TOP_LEFT, BOTTOM_RIGHT);
+ AddAnchor((UINT)IDC_STATIC, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_RADIO1, TOP_RIGHT);
AddAnchor(IDC_RADIO2, TOP_RIGHT);
diff --git a/src/mpc-hc/DropTarget.h b/src/mpc-hc/DropTarget.h
index a501e5d29..8df0680ed 100644
--- a/src/mpc-hc/DropTarget.h
+++ b/src/mpc-hc/DropTarget.h
@@ -36,7 +36,7 @@ public:
virtual ~CDropTarget() = default;
private:
- const UINT CF_URL = RegisterClipboardFormat(_T("UniformResourceLocator"));
+ const CLIPFORMAT CF_URL = (CLIPFORMAT)RegisterClipboardFormat(_T("UniformResourceLocator"));
CComPtr<IDropTargetHelper> m_pDropHelper;
protected:
diff --git a/src/mpc-hc/PPageAccelTbl.cpp b/src/mpc-hc/PPageAccelTbl.cpp
index 94c6271e1..3fba403f0 100644
--- a/src/mpc-hc/PPageAccelTbl.cpp
+++ b/src/mpc-hc/PPageAccelTbl.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -1168,7 +1168,8 @@ void CPPageAccelTbl::OnEndListLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)
wc.fVirt |= FSHIFT;
}
wc.fVirt |= FVIRTKEY;
- wc.key = cod;
+ ASSERT(cod < WORD_MAX);
+ wc.key = (WORD)cod;
CString str;
HotkeyToString(cod, mod, str);
diff --git a/src/mpc-hc/PPageAudioSwitcher.cpp b/src/mpc-hc/PPageAudioSwitcher.cpp
index 7a0f4f9b2..6ecb5048d 100644
--- a/src/mpc-hc/PPageAudioSwitcher.cpp
+++ b/src/mpc-hc/PPageAudioSwitcher.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -396,7 +396,7 @@ void CPPageAudioSwitcher::OnCancel()
{
const CAppSettings& s = AfxGetAppSettings();
- if (m_AudioBoostPos != s.nAudioBoost) {
+ if ((UINT)m_AudioBoostPos != s.nAudioBoost) {
((CMainFrame*)GetParentFrame())->SetVolumeBoost(s.nAudioBoost);
}
diff --git a/src/mpc-hc/PPageOutput.cpp b/src/mpc-hc/PPageOutput.cpp
index d31308fed..631a19c16 100644
--- a/src/mpc-hc/PPageOutput.cpp
+++ b/src/mpc-hc/PPageOutput.cpp
@@ -331,7 +331,7 @@ BOOL CPPageOutput::OnInitDialog()
addRenderer(VIDRNDT_DS_NULL_UNCOMP);
for (int j = 0; j < m_iDSVRTC.GetCount(); ++j) {
- if (m_iDSVideoRendererType == m_iDSVRTC.GetItemData(j)) {
+ if ((UINT)m_iDSVideoRendererType == m_iDSVRTC.GetItemData(j)) {
m_iDSVRTC.SetCurSel(j);
break;
}
@@ -419,7 +419,7 @@ BOOL CPPageOutput::OnApply()
// revert to the renderer in the settings
m_iDSVideoRendererTypeCtrl.SetCurSel(0);
for (int i = 0; i < m_iDSVideoRendererTypeCtrl.GetCount(); ++i) {
- if (s.iDSVideoRendererType == m_iDSVideoRendererTypeCtrl.GetItemData(i)) {
+ if ((UINT)s.iDSVideoRendererType == m_iDSVideoRendererTypeCtrl.GetItemData(i)) {
m_iDSVideoRendererTypeCtrl.SetCurSel(i);
break;
}
diff --git a/src/mpc-hc/PPageSubStyle.cpp b/src/mpc-hc/PPageSubStyle.cpp
index 26ce6a4ff..5be4ab076 100644
--- a/src/mpc-hc/PPageSubStyle.cpp
+++ b/src/mpc-hc/PPageSubStyle.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -214,7 +214,8 @@ BOOL CPPageSubStyle::OnApply()
m_stss.relativeTo = (STSStyle::RelativeTo)m_iRelativeTo;
for (size_t i = 0; i < m_alpha.size(); i++) {
- m_stss.alpha[i] = BYTE_MAX - m_alpha[i];
+ ASSERT(m_alpha[i] <= BYTE_MAX);
+ m_stss.alpha[i] = BYTE_MAX - BYTE(m_alpha[i]);
}
if (m_bDefaultStyle) {
diff --git a/src/mpc-hc/QuicktimeGraph.cpp b/src/mpc-hc/QuicktimeGraph.cpp
index b2e69bab2..976c60a9e 100644
--- a/src/mpc-hc/QuicktimeGraph.cpp
+++ b/src/mpc-hc/QuicktimeGraph.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2015 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -509,7 +509,7 @@ bool CQuicktimeWindow::OpenMovie(CString fn)
CHAR buff[MAX_PATH] = {0, 0};
WideCharToMultiByte(GetACP(), 0, fn, -1, buff + 1, _countof(buff) - 1, 0, 0);
- buff[0] = strlen(buff + 1);
+ buff[0] = (CHAR)strlen(buff + 1);
// Make a FSSpec with a pascal string filename
FSSpec sfFile;
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp
index fd66bb139..b6ff429e1 100644
--- a/src/mpc-hc/mplayerc.cpp
+++ b/src/mpc-hc/mplayerc.cpp
@@ -1024,7 +1024,7 @@ BOOL CMPlayerCApp::GetProfileBinary(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPBY
return FALSE;
}
for (UINT i = 0; i < *pBytes; i++) {
- (*ppData)[i] = (valueStr[i * 2] - 'A') | ((valueStr[i * 2 + 1] - 'A') << 4);
+ (*ppData)[i] = BYTE((valueStr[i * 2] - 'A') | ((valueStr[i * 2 + 1] - 'A') << 4));
}
return TRUE;
}