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:
authorv0lt <v0lt@users.sourceforge.net>2012-06-03 00:50:16 +0400
committerv0lt <v0lt@users.sourceforge.net>2012-06-03 00:50:16 +0400
commitfa6b2076cc60581f246741bf0a5598d43dcad326 (patch)
tree8ab4bba5250ac0b76a76d42acc4cae8e335f50c7 /src/filters/parser/BaseSplitter
parent3ec74c31d0da6199fda5c5632c3fdbaa70428583 (diff)
splitters: fixed some warnings.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4984 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/BaseSplitter')
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.cpp14
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.h2
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp34
3 files changed, 25 insertions, 25 deletions
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
index c6bf35946..4787c6222 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
@@ -48,9 +48,9 @@ void CPacketQueue::Add(CAutoPtr<Packet> p)
&& p->rtStart == Packet::INVALID_TIME
&& !IsEmpty() && GetTail()->rtStart != Packet::INVALID_TIME) {
Packet* tail = GetTail();
- int oldsize = tail->GetCount();
- int newsize = tail->GetCount() + p->GetCount();
- tail->SetCount(newsize, max(1024, newsize)); // doubles the reserved buffer size
+ size_t oldsize = tail->GetCount();
+ size_t newsize = tail->GetCount() + p->GetCount();
+ tail->SetCount(newsize, max(1024, (int)newsize)); // doubles the reserved buffer size
memcpy(tail->GetData() + oldsize, p->GetData(), p->GetCount());
/*
GetTail()->Append(*p); // too slow
@@ -83,7 +83,7 @@ void CPacketQueue::RemoveAll()
int CPacketQueue::GetCount()
{
CAutoLock cAutoLock(this);
- return __super::GetCount();
+ return (int)__super::GetCount();
}
int CPacketQueue::GetSize()
@@ -512,7 +512,7 @@ HRESULT CBaseSplitterOutputPin::DeliverPacket(CAutoPtr<Packet> p)
{
HRESULT hr;
- INT_PTR nBytes = p->GetCount();
+ long nBytes = (long)p->GetCount();
if (nBytes == 0) {
return S_OK;
@@ -1162,7 +1162,7 @@ HRESULT CBaseSplitterFilter::CompleteConnect(PIN_DIRECTION dir, CBasePin* pPin)
int CBaseSplitterFilter::GetPinCount()
{
- return (m_pInput ? 1 : 0) + m_pOutputs.GetCount();
+ return (m_pInput ? 1 : 0) + (int)m_pOutputs.GetCount();
}
CBasePin* CBaseSplitterFilter::GetPin(int n)
@@ -1594,7 +1594,7 @@ STDMETHODIMP_(int) CBaseSplitterFilter::GetCount()
{
CAutoLock cAutoLock(m_pLock);
- return m_pOutputs.GetCount();
+ return (int)m_pOutputs.GetCount();
}
STDMETHODIMP CBaseSplitterFilter::GetStatus(int i, int& samples, int& size)
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.h b/src/filters/parser/BaseSplitter/BaseSplitter.h
index 5cd04bca0..0cd998dd4 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.h
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.h
@@ -119,7 +119,7 @@ public:
DeleteMediaType(pmt);
}
}
- virtual int GetDataSize() {return GetCount();}
+ virtual int GetDataSize() {return (int)GetCount();}
void SetData(const void* ptr, DWORD len) {
SetCount(len);
memcpy(GetData(), ptr, len);
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
index c84751383..6873c338c 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
@@ -406,7 +406,7 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
if (type == mpeg1) {
pmt->subtype = MEDIASUBTYPE_MPEG1Payload;
pmt->formattype = FORMAT_MPEGVideo;
- int len = FIELD_OFFSET(MPEG1VIDEOINFO, bSequenceHeader) + shlen + shextlen;
+ int len = FIELD_OFFSET(MPEG1VIDEOINFO, bSequenceHeader) + int(shlen + shextlen);
MPEG1VIDEOINFO* vi = (MPEG1VIDEOINFO*)DNew BYTE[len];
memset(vi, 0, len);
vi->hdr.dwBitRate = h.bitrate;
@@ -428,7 +428,7 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
} else if (type == mpeg2) {
pmt->subtype = MEDIASUBTYPE_MPEG2_VIDEO;
pmt->formattype = FORMAT_MPEG2_VIDEO;
- int len = FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + shlen + shextlen;
+ int len = FIELD_OFFSET(MPEG2VIDEOINFO, dwSequenceHeader) + int(shlen + shextlen);
MPEG2VIDEOINFO* vi = (MPEG2VIDEOINFO*)DNew BYTE[len];
memset(vi, 0, len);
vi->hdr.dwBitRate = h.bitrate;
@@ -539,12 +539,12 @@ bool CBaseSplitterFileEx::Read(mpahdr& h, int len, bool fAllowV25, CMediaType* p
return true;
}
- /*int*/ len = h.layer == 3
+ size_t size = h.layer == 3
? sizeof(WAVEFORMATEX/*MPEGLAYER3WAVEFORMAT*/) // no need to overcomplicate this...
: sizeof(MPEG1WAVEFORMAT);
- WAVEFORMATEX* wfe = (WAVEFORMATEX*)DNew BYTE[len];
- memset(wfe, 0, len);
- wfe->cbSize = len - sizeof(WAVEFORMATEX);
+ WAVEFORMATEX* wfe = (WAVEFORMATEX*)DNew BYTE[size];
+ memset(wfe, 0, size);
+ wfe->cbSize = WORD(size - sizeof(WAVEFORMATEX));
if (h.layer == 3) {
wfe->wFormatTag = WAVE_FORMAT_MP3;
@@ -988,18 +988,18 @@ bool CBaseSplitterFileEx::Read(dvdalpcmhdr& h, int len, CMediaType* pmt)
memset(&h, 0, sizeof(h));
if (len < 8) return false;
- h.firstaudioframe = BitRead(16);// Byte pointer to start of first audio frame.
- h.unknown1 = BitRead(8); // Unknown - e.g. 0x10 for stereo, 0x00 for surround
+ h.firstaudioframe = (WORD)BitRead(16);// Byte pointer to start of first audio frame.
+ h.unknown1 = (BYTE)BitRead(8); // Unknown - e.g. 0x10 for stereo, 0x00 for surround
if (h.unknown1!= 0x10 && h.unknown1!= 0x00)
return false; // this is not the aob. maybe this is a vob.
- h.bitpersample1 = BitRead(4);
- h.bitpersample2 = BitRead(4);
- h.samplerate1 = BitRead(4);
- h.samplerate2 = BitRead(4);
- h.unknown2 = BitRead(8); // Unknown - e.g. 0x00
- h.groupassignment = BitRead(8); // Channel Group Assignment
- h.unknown3 = BitRead(8); // Unknown - e.g. 0x80
+ h.bitpersample1 = (BYTE)BitRead(4);
+ h.bitpersample2 = (BYTE)BitRead(4);
+ h.samplerate1 = (BYTE)BitRead(4);
+ h.samplerate2 = (BYTE)BitRead(4);
+ h.unknown2 = (BYTE)BitRead(8); // Unknown - e.g. 0x00
+ h.groupassignment = (BYTE)BitRead(8); // Channel Group Assignment
+ h.unknown3 = (BYTE)BitRead(8); // Unknown - e.g. 0x80
if (h.bitpersample1 > 2 || (h.samplerate1&7) > 2 || h.groupassignment > 20 ||
h.unknown2 != 0x00 || h.unknown3 != 0x80) {
@@ -1027,7 +1027,7 @@ bool CBaseSplitterFileEx::Read(dvdalpcmhdr& h, int len, CMediaType* pmt)
wfe.nChannels = channels1[h.groupassignment]+channels2[h.groupassignment];
if (wfe.nChannels > 2) {
- wfe.nBlockAlign = (depth[h.bitpersample1] * channels1[h.groupassignment] * (freq[h.samplerate1] / freq[h.samplerate2]) +
+ wfe.nBlockAlign = (depth[h.bitpersample1] * channels1[h.groupassignment] * (WORD)(freq[h.samplerate1] / freq[h.samplerate2]) +
depth[h.bitpersample2] * channels2[h.groupassignment]) * 2 / 8;
} else {
wfe.nBlockAlign = depth[h.bitpersample1] * channels1[h.groupassignment] * 2 / 8;
@@ -1604,7 +1604,7 @@ bool CBaseSplitterFileEx::Read(avchdr& h, int len, CMediaType* pmt)
// Copy into buffer
Seek(nalstartpos);
unsigned int bufsize = _countof(h.spspps[index].buffer);
- int len = min(bufsize - h.spspps[index].size, pos - nalstartpos);
+ int len = min(int(bufsize - h.spspps[index].size), int(pos - nalstartpos));
ByteRead(h.spspps[index].buffer+h.spspps[index].size, len);
Seek(pos);
h.spspps[index].size += len;