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:
Diffstat (limited to 'src/filters/reader')
-rw-r--r--src/filters/reader/CDDAReader/CDDAReader.cpp254
-rw-r--r--src/filters/reader/CDDAReader/CDDAReader.h89
-rw-r--r--src/filters/reader/CDDAReader/stdafx.cpp6
-rw-r--r--src/filters/reader/CDDAReader/stdafx.h6
-rw-r--r--src/filters/reader/CDXAReader/CDXAReader.cpp228
-rw-r--r--src/filters/reader/CDXAReader/CDXAReader.h29
-rw-r--r--src/filters/reader/CDXAReader/stdafx.cpp6
-rw-r--r--src/filters/reader/CDXAReader/stdafx.h6
-rw-r--r--src/filters/reader/UDPReader/UDPReader.cpp290
-rw-r--r--src/filters/reader/UDPReader/UDPReader.h36
-rw-r--r--src/filters/reader/UDPReader/stdafx.cpp6
-rw-r--r--src/filters/reader/UDPReader/stdafx.h6
-rw-r--r--src/filters/reader/VTSReader/VTSReader.cpp76
-rw-r--r--src/filters/reader/VTSReader/VTSReader.h26
-rw-r--r--src/filters/reader/VTSReader/stdafx.cpp6
-rw-r--r--src/filters/reader/VTSReader/stdafx.h6
16 files changed, 580 insertions, 496 deletions
diff --git a/src/filters/reader/CDDAReader/CDDAReader.cpp b/src/filters/reader/CDDAReader/CDDAReader.cpp
index bc74ac8a5..d0515786b 100644
--- a/src/filters/reader/CDDAReader/CDDAReader.cpp
+++ b/src/filters/reader/CDDAReader/CDDAReader.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -29,23 +29,19 @@
#ifdef REGISTER_FILTER
-const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
-{
+const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
{&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE},
};
-const AMOVIESETUP_PIN sudOpPin[] =
-{
+const AMOVIESETUP_PIN sudOpPin[] = {
{L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesOut), sudPinTypesOut},
};
-const AMOVIESETUP_FILTER sudFilter[] =
-{
+const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CCDDAReader), L"MPC - CDDA Reader", MERIT_NORMAL, countof(sudOpPin), sudOpPin, CLSID_LegacyAmFilterCategory}
};
-CFactoryTemplate g_Templates[] =
-{
+CFactoryTemplate g_Templates[] = {
{sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDDAReader>, NULL, &sudFilter[0]}
};
@@ -53,22 +49,21 @@ int g_cTemplates = countof(g_Templates);
STDAPI DllRegisterServer()
{
- if(GetVersion()&0x80000000)
- {
+ if(GetVersion()&0x80000000) {
::MessageBox(NULL, _T("Sorry, this will only run on Windows NT based operating system."), _T("CDDA Reader"), MB_OK);
return E_NOTIMPL;
}
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"),
_T("0"), _T("0,4,,52494646,8,4,,43444441")); // "RIFFxxxxCDDA"
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"),
_T("Source Filter"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"));
SetRegKeyValue(
- _T("Media Type\\Extensions"), _T(".cda"),
+ _T("Media Type\\Extensions"), _T(".cda"),
_T("Source Filter"), _T("{54A35221-2C8D-4a31-A5DF-6D809847E393}"));
return AMovieDllRegisterServer2(TRUE);
@@ -95,11 +90,14 @@ CFilterApp theApp;
CCDDAReader::CCDDAReader(IUnknown* pUnk, HRESULT* phr)
: CAsyncReader(NAME("CCDDAReader"), pUnk, &m_stream, phr, __uuidof(this))
{
- if(phr) *phr = S_OK;
+ if(phr) {
+ *phr = S_OK;
+ }
- if(GetVersion()&0x80000000)
- {
- if(phr) *phr = E_NOTIMPL;
+ if(GetVersion()&0x80000000) {
+ if(phr) {
+ *phr = E_NOTIMPL;
+ }
return;
}
}
@@ -110,9 +108,9 @@ CCDDAReader::~CCDDAReader()
STDMETHODIMP CCDDAReader::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- CheckPointer(ppv, E_POINTER);
+ CheckPointer(ppv, E_POINTER);
- return
+ return
QI(IFileSourceFilter)
QI2(IAMMediaContent)
__super::NonDelegatingQueryInterface(riid, ppv);
@@ -120,10 +118,11 @@ STDMETHODIMP CCDDAReader::NonDelegatingQueryInterface(REFIID riid, void** ppv)
// IFileSourceFilter
-STDMETHODIMP CCDDAReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
+STDMETHODIMP CCDDAReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
- if(!m_stream.Load(pszFileName))
+ if(!m_stream.Load(pszFileName)) {
return E_FAIL;
+ }
m_fn = pszFileName;
@@ -140,8 +139,9 @@ STDMETHODIMP CCDDAReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
CheckPointer(ppszFileName, E_POINTER);
*ppszFileName = (LPOLESTR)CoTaskMemAlloc((m_fn.GetLength()+1)*sizeof(WCHAR));
- if(!(*ppszFileName))
+ if(!(*ppszFileName)) {
return E_OUTOFMEMORY;
+ }
wcscpy(*ppszFileName, m_fn);
@@ -150,16 +150,30 @@ STDMETHODIMP CCDDAReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
// IAMMediaContent
-STDMETHODIMP CCDDAReader::GetTypeInfoCount(UINT* pctinfo) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::GetIDsOfNames(REFIID riid, OLECHAR** rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr) {return E_NOTIMPL;}
+STDMETHODIMP CCDDAReader::GetTypeInfoCount(UINT* pctinfo)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::GetIDsOfNames(REFIID riid, OLECHAR** rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr)
+{
+ return E_NOTIMPL;
+}
STDMETHODIMP CCDDAReader::get_AuthorName(BSTR* pbstrAuthorName)
{
CheckPointer(pbstrAuthorName, E_POINTER);
CString str = m_stream.m_trackArtist;
- if(str.IsEmpty()) str = m_stream.m_discArtist;
+ if(str.IsEmpty()) {
+ str = m_stream.m_discArtist;
+ }
*pbstrAuthorName = str.AllocSysString();
return S_OK;
}
@@ -168,22 +182,57 @@ STDMETHODIMP CCDDAReader::get_Title(BSTR* pbstrTitle)
{
CheckPointer(pbstrTitle, E_POINTER);
CString str = m_stream.m_trackTitle;
- if(str.IsEmpty()) str = m_stream.m_discTitle;
+ if(str.IsEmpty()) {
+ str = m_stream.m_discTitle;
+ }
*pbstrTitle = str.AllocSysString();
return S_OK;
}
-STDMETHODIMP CCDDAReader::get_Rating(BSTR* pbstrRating) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_Description(BSTR* pbstrDescription) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_Copyright(BSTR* pbstrCopyright) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_BaseURL(BSTR* pbstrBaseURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_LogoURL(BSTR* pbstrLogoURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_LogoIconURL(BSTR* pbstrLogoURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_WatermarkURL(BSTR* pbstrWatermarkURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_MoreInfoURL(BSTR* pbstrMoreInfoURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_MoreInfoBannerImage(BSTR* pbstrMoreInfoBannerImage) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_MoreInfoBannerURL(BSTR* pbstrMoreInfoBannerURL) {return E_NOTIMPL;}
-STDMETHODIMP CCDDAReader::get_MoreInfoText(BSTR* pbstrMoreInfoText) {return E_NOTIMPL;}
+STDMETHODIMP CCDDAReader::get_Rating(BSTR* pbstrRating)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_Description(BSTR* pbstrDescription)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_Copyright(BSTR* pbstrCopyright)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_BaseURL(BSTR* pbstrBaseURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_LogoURL(BSTR* pbstrLogoURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_LogoIconURL(BSTR* pbstrLogoURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_WatermarkURL(BSTR* pbstrWatermarkURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_MoreInfoURL(BSTR* pbstrMoreInfoURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_MoreInfoBannerImage(BSTR* pbstrMoreInfoBannerImage)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_MoreInfoBannerURL(BSTR* pbstrMoreInfoBannerURL)
+{
+ return E_NOTIMPL;
+}
+STDMETHODIMP CCDDAReader::get_MoreInfoText(BSTR* pbstrMoreInfoText)
+{
+ return E_NOTIMPL;
+}
// CCDDAStream
@@ -212,8 +261,7 @@ CCDDAStream::CCDDAStream()
CCDDAStream::~CCDDAStream()
{
- if(m_hDrive != INVALID_HANDLE_VALUE)
- {
+ if(m_hDrive != INVALID_HANDLE_VALUE) {
CloseHandle(m_hDrive);
m_hDrive = INVALID_HANDLE_VALUE;
}
@@ -225,31 +273,32 @@ bool CCDDAStream::Load(const WCHAR* fnw)
int iDriveLetter = path.Find(_T(":\\"))-1;
int iTrackIndex = CString(path).MakeLower().Find(_T(".cda"))-1;
- if(iDriveLetter < 0 || iTrackIndex <= iDriveLetter)
+ if(iDriveLetter < 0 || iTrackIndex <= iDriveLetter) {
return(false);
+ }
CString drive = CString(_T("\\\\.\\")) + path[iDriveLetter] + _T(":");
- while(iTrackIndex > 0 && _istdigit(path[iTrackIndex-1])) iTrackIndex--;
- if(1 != _stscanf(path.Mid(iTrackIndex), _T("%d"), &iTrackIndex))
+ while(iTrackIndex > 0 && _istdigit(path[iTrackIndex-1])) {
+ iTrackIndex--;
+ }
+ if(1 != _stscanf(path.Mid(iTrackIndex), _T("%d"), &iTrackIndex)) {
return(false);
+ }
- if(m_hDrive != INVALID_HANDLE_VALUE)
- {
+ if(m_hDrive != INVALID_HANDLE_VALUE) {
CloseHandle(m_hDrive);
m_hDrive = INVALID_HANDLE_VALUE;
}
- m_hDrive = CreateFile(drive, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_READONLY|FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
- if(m_hDrive == INVALID_HANDLE_VALUE)
- {
+ m_hDrive = CreateFile(drive, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_READONLY|FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
+ if(m_hDrive == INVALID_HANDLE_VALUE) {
return(false);
}
DWORD BytesReturned;
if(!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC, NULL, 0, &m_TOC, sizeof(m_TOC), &BytesReturned, 0)
- || !(m_TOC.FirstTrack <= iTrackIndex && iTrackIndex <= m_TOC.LastTrack))
- {
+ || !(m_TOC.FirstTrack <= iTrackIndex && iTrackIndex <= m_TOC.LastTrack)) {
CloseHandle(m_hDrive);
m_hDrive = INVALID_HANDLE_VALUE;
return(false);
@@ -257,15 +306,15 @@ bool CCDDAStream::Load(const WCHAR* fnw)
// MMC-3 Draft Revision 10g: Table 222 – Q Sub-channel control field
m_TOC.TrackData[iTrackIndex-1].Control &= 5;
- if(!(m_TOC.TrackData[iTrackIndex-1].Control == 0 || m_TOC.TrackData[iTrackIndex-1].Control == 1))
- {
+ if(!(m_TOC.TrackData[iTrackIndex-1].Control == 0 || m_TOC.TrackData[iTrackIndex-1].Control == 1)) {
CloseHandle(m_hDrive);
m_hDrive = INVALID_HANDLE_VALUE;
return(false);
}
- if(m_TOC.TrackData[iTrackIndex-1].Control&8)
+ if(m_TOC.TrackData[iTrackIndex-1].Control&8) {
m_header.frm.pcm.wf.nChannels = 4;
+ }
m_nStartSector = MSF2UINT(m_TOC.TrackData[iTrackIndex-1].Address) - 150;//MSF2UINT(m_TOC.TrackData[0].Address);
m_nStopSector = MSF2UINT(m_TOC.TrackData[iTrackIndex].Address) - 150;//MSF2UINT(m_TOC.TrackData[0].Address);
@@ -275,16 +324,16 @@ bool CCDDAStream::Load(const WCHAR* fnw)
m_header.riff.hdr.chunkSize = (long)(m_llLength + sizeof(m_header) - 8);
m_header.data.hdr.chunkSize = (long)(m_llLength);
- do
- {
+ do {
CDROM_READ_TOC_EX TOCEx;
memset(&TOCEx, 0, sizeof(TOCEx));
TOCEx.Format = CDROM_READ_TOC_EX_FORMAT_CDTEXT;
TOCEx.SessionTrack = iTrackIndex;
WORD size = 0;
ASSERT(MINIMUM_CDROM_READ_TOC_EX_SIZE == sizeof(size));
- if(!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC_EX, &TOCEx, sizeof(TOCEx), &size, sizeof(size), &BytesReturned, 0))
+ if(!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC_EX, &TOCEx, sizeof(TOCEx), &size, sizeof(size), &BytesReturned, 0)) {
break;
+ }
size = ((size>>8)|(size<<8)) + sizeof(size);
@@ -292,50 +341,48 @@ bool CCDDAStream::Load(const WCHAR* fnw)
pCDTextData.Allocate(size);
memset(pCDTextData, 0, size);
- if(!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC_EX, &TOCEx, sizeof(TOCEx), pCDTextData, size, &BytesReturned, 0))
+ if(!DeviceIoControl(m_hDrive, IOCTL_CDROM_READ_TOC_EX, &TOCEx, sizeof(TOCEx), pCDTextData, size, &BytesReturned, 0)) {
break;
+ }
size = (WORD)(BytesReturned - sizeof(CDROM_TOC_CD_TEXT_DATA));
CDROM_TOC_CD_TEXT_DATA_BLOCK* pDesc = ((CDROM_TOC_CD_TEXT_DATA*)(BYTE*)pCDTextData)->Descriptors;
CStringArray str[16];
- for(int i = 0; i < 16; i++) str[i].SetSize(1+m_TOC.LastTrack);
+ for(int i = 0; i < 16; i++) {
+ str[i].SetSize(1+m_TOC.LastTrack);
+ }
CString last;
- for(int i = 0; size >= sizeof(CDROM_TOC_CD_TEXT_DATA_BLOCK); i++, size -= sizeof(CDROM_TOC_CD_TEXT_DATA_BLOCK), pDesc++)
- {
- if(pDesc->TrackNumber > m_TOC.LastTrack)
+ for(int i = 0; size >= sizeof(CDROM_TOC_CD_TEXT_DATA_BLOCK); i++, size -= sizeof(CDROM_TOC_CD_TEXT_DATA_BLOCK), pDesc++) {
+ if(pDesc->TrackNumber > m_TOC.LastTrack) {
continue;
+ }
const int lenU = countof(pDesc->Text);
const int lenW = countof(pDesc->WText);
- CString text = !pDesc->Unicode
- ? CString(CStringA((CHAR*)pDesc->Text, lenU))
- : CString(CStringW((WCHAR*)pDesc->WText, lenW));
+ CString text = !pDesc->Unicode
+ ? CString(CStringA((CHAR*)pDesc->Text, lenU))
+ : CString(CStringW((WCHAR*)pDesc->WText, lenW));
int tlen = text.GetLength();
CString tmp = (tlen < 12-1)
- ? (!pDesc->Unicode
- ? CString(CStringA((CHAR*)pDesc->Text+tlen+1, lenU-(tlen+1)))
- : CString(CStringW((WCHAR*)pDesc->WText+tlen+1, lenW-(tlen+1))))
- : _T("");
+ ? (!pDesc->Unicode
+ ? CString(CStringA((CHAR*)pDesc->Text+tlen+1, lenU-(tlen+1)))
+ : CString(CStringW((WCHAR*)pDesc->WText+tlen+1, lenW-(tlen+1))))
+ : _T("");
- if((pDesc->PackType -= 0x80) >= 0x10)
+ if((pDesc->PackType -= 0x80) >= 0x10) {
continue;
+ }
- if(pDesc->CharacterPosition == 0)
- {
+ if(pDesc->CharacterPosition == 0) {
str[pDesc->PackType][pDesc->TrackNumber] = text;
- }
- else if(pDesc->CharacterPosition <= 0xf)
- {
- if(pDesc->CharacterPosition < 0xf && last.GetLength() > 0)
- {
+ } else if(pDesc->CharacterPosition <= 0xf) {
+ if(pDesc->CharacterPosition < 0xf && last.GetLength() > 0) {
str[pDesc->PackType][pDesc->TrackNumber] = last + text;
- }
- else
- {
+ } else {
str[pDesc->PackType][pDesc->TrackNumber] += text;
}
}
@@ -347,16 +394,17 @@ bool CCDDAStream::Load(const WCHAR* fnw)
m_trackTitle = str[0][iTrackIndex];
m_discArtist = str[1][0];
m_trackArtist = str[1][iTrackIndex];
- }
- while(0);
-
+ } while(0);
+
return(true);
}
HRESULT CCDDAStream::SetPointer(LONGLONG llPos)
{
- if(llPos < 0 || llPos > m_llLength) return S_FALSE;
+ if(llPos < 0 || llPos > m_llLength) {
+ return S_FALSE;
+ }
m_llPosition = llPos;
return S_OK;
}
@@ -371,8 +419,7 @@ HRESULT CCDDAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
LONGLONG pos = m_llPosition;
size_t len = (size_t)dwBytesToRead;
- if(pos < sizeof(m_header) && len > 0)
- {
+ if(pos < sizeof(m_header) && len > 0) {
size_t l = (size_t)min(len, sizeof(m_header) - pos);
memcpy(pbBuffer, &((BYTE*)&m_header)[pos], l);
pbBuffer += l;
@@ -382,8 +429,7 @@ HRESULT CCDDAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
pos -= sizeof(m_header);
- while(pos >= 0 && pos < m_llLength && len > 0)
- {
+ while(pos >= 0 && pos < m_llLength && len > 0) {
RAW_READ_INFO rawreadinfo;
rawreadinfo.SectorCount = 1;
rawreadinfo.TrackMode = CDDA;
@@ -394,10 +440,10 @@ HRESULT CCDDAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
rawreadinfo.DiskOffset.QuadPart = sector*2048;
DWORD BytesReturned = 0;
BOOL b = DeviceIoControl(
- m_hDrive, IOCTL_CDROM_RAW_READ,
- &rawreadinfo, sizeof(rawreadinfo),
- buff, RAW_SECTOR_SIZE,
- &BytesReturned, 0);
+ m_hDrive, IOCTL_CDROM_RAW_READ,
+ &rawreadinfo, sizeof(rawreadinfo),
+ buff, RAW_SECTOR_SIZE,
+ &BytesReturned, 0);
UNUSED_ALWAYS(b);
size_t l = (size_t)min(min(len, RAW_SECTOR_SIZE - offset), m_llLength - pos);
@@ -408,7 +454,9 @@ HRESULT CCDDAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
len -= l;
}
- if(pdwBytesRead) *pdwBytesRead = pbBuffer - pbBufferOrg;
+ if(pdwBytesRead) {
+ *pdwBytesRead = pbBuffer - pbBufferOrg;
+ }
m_llPosition += pbBuffer - pbBufferOrg;
return S_OK;
@@ -417,22 +465,24 @@ HRESULT CCDDAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
LONGLONG CCDDAStream::Size(LONGLONG* pSizeAvailable)
{
LONGLONG size = sizeof(m_header) + m_llLength;
- if(pSizeAvailable) *pSizeAvailable = size;
- return size;
+ if(pSizeAvailable) {
+ *pSizeAvailable = size;
+ }
+ return size;
}
DWORD CCDDAStream::Alignment()
{
- return 1;
+ return 1;
}
void CCDDAStream::Lock()
{
- m_csLock.Lock();
+ m_csLock.Lock();
}
void CCDDAStream::Unlock()
{
- m_csLock.Unlock();
+ m_csLock.Unlock();
}
diff --git a/src/filters/reader/CDDAReader/CDDAReader.h b/src/filters/reader/CDDAReader/CDDAReader.h
index cccee0987..f491b38ce 100644
--- a/src/filters/reader/CDDAReader/CDDAReader.h
+++ b/src/filters/reader/CDDAReader/CDDAReader.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -28,24 +28,39 @@
#include "../AsyncReader/asyncio.h"
#include "../AsyncReader/asyncrdr.h"
-typedef struct {UINT chunkID; long chunkSize;} ChunkHeader;
+typedef struct {
+ UINT chunkID;
+ long chunkSize;
+} ChunkHeader;
-#define RIFFID 'FFIR'
-#define WAVEID 'EVAW'
-typedef struct {ChunkHeader hdr; UINT WAVE;} RIFFChunk;
+#define RIFFID 'FFIR'
+#define WAVEID 'EVAW'
+typedef struct {
+ ChunkHeader hdr;
+ UINT WAVE;
+} RIFFChunk;
-#define FormatID ' tmf'
-typedef struct {ChunkHeader hdr; PCMWAVEFORMAT pcm;} FormatChunk;
+#define FormatID ' tmf'
+typedef struct {
+ ChunkHeader hdr;
+ PCMWAVEFORMAT pcm;
+} FormatChunk;
#define DataID 'atad'
-typedef struct {ChunkHeader hdr;} DataChunk;
+typedef struct {
+ ChunkHeader hdr;
+} DataChunk;
-typedef struct {RIFFChunk riff; FormatChunk frm; DataChunk data;} WAVEChunck;
+typedef struct {
+ RIFFChunk riff;
+ FormatChunk frm;
+ DataChunk data;
+} WAVEChunck;
class CCDDAStream : public CAsyncStream
{
private:
- CCritSec m_csLock;
+ CCritSec m_csLock;
LONGLONG m_llPosition, m_llLength;
@@ -65,29 +80,29 @@ public:
bool Load(const WCHAR* fnw);
// overrides
- HRESULT SetPointer(LONGLONG llPos);
- HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
- LONGLONG Size(LONGLONG* pSizeAvailable);
- DWORD Alignment();
- void Lock();
+ HRESULT SetPointer(LONGLONG llPos);
+ HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
+ LONGLONG Size(LONGLONG* pSizeAvailable);
+ DWORD Alignment();
+ void Lock();
void Unlock();
};
class __declspec(uuid("54A35221-2C8D-4a31-A5DF-6D809847E393"))
-CCDDAReader
+ CCDDAReader
: public CAsyncReader
, public IFileSourceFilter
, public IAMMediaContent
{
- CCDDAStream m_stream;
+ CCDDAStream m_stream;
CStringW m_fn;
public:
- CCDDAReader(IUnknown* pUnk, HRESULT* phr);
+ CCDDAReader(IUnknown* pUnk, HRESULT* phr);
~CCDDAReader();
DECLARE_IUNKNOWN;
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
// IFileSourceFilter
@@ -96,23 +111,23 @@ public:
// IAMMediaContent
- STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
+ STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
- STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
-
- STDMETHODIMP get_AuthorName(BSTR* pbstrAuthorName);
- STDMETHODIMP get_Title(BSTR* pbstrTitle);
- STDMETHODIMP get_Rating(BSTR* pbstrRating);
- STDMETHODIMP get_Description(BSTR* pbstrDescription);
- STDMETHODIMP get_Copyright(BSTR* pbstrCopyright);
- STDMETHODIMP get_BaseURL(BSTR* pbstrBaseURL);
- STDMETHODIMP get_LogoURL(BSTR* pbstrLogoURL);
- STDMETHODIMP get_LogoIconURL(BSTR* pbstrLogoURL);
- STDMETHODIMP get_WatermarkURL(BSTR* pbstrWatermarkURL);
- STDMETHODIMP get_MoreInfoURL(BSTR* pbstrMoreInfoURL);
- STDMETHODIMP get_MoreInfoBannerImage(BSTR* pbstrMoreInfoBannerImage);
- STDMETHODIMP get_MoreInfoBannerURL(BSTR* pbstrMoreInfoBannerURL);
- STDMETHODIMP get_MoreInfoText(BSTR* pbstrMoreInfoText);
+ STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
+
+ STDMETHODIMP get_AuthorName(BSTR* pbstrAuthorName);
+ STDMETHODIMP get_Title(BSTR* pbstrTitle);
+ STDMETHODIMP get_Rating(BSTR* pbstrRating);
+ STDMETHODIMP get_Description(BSTR* pbstrDescription);
+ STDMETHODIMP get_Copyright(BSTR* pbstrCopyright);
+ STDMETHODIMP get_BaseURL(BSTR* pbstrBaseURL);
+ STDMETHODIMP get_LogoURL(BSTR* pbstrLogoURL);
+ STDMETHODIMP get_LogoIconURL(BSTR* pbstrLogoURL);
+ STDMETHODIMP get_WatermarkURL(BSTR* pbstrWatermarkURL);
+ STDMETHODIMP get_MoreInfoURL(BSTR* pbstrMoreInfoURL);
+ STDMETHODIMP get_MoreInfoBannerImage(BSTR* pbstrMoreInfoBannerImage);
+ STDMETHODIMP get_MoreInfoBannerURL(BSTR* pbstrMoreInfoBannerURL);
+ STDMETHODIMP get_MoreInfoText(BSTR* pbstrMoreInfoText);
};
diff --git a/src/filters/reader/CDDAReader/stdafx.cpp b/src/filters/reader/CDDAReader/stdafx.cpp
index 13934d005..bea3f980a 100644
--- a/src/filters/reader/CDDAReader/stdafx.cpp
+++ b/src/filters/reader/CDDAReader/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/CDDAReader/stdafx.h b/src/filters/reader/CDDAReader/stdafx.h
index 62d50a36b..d1c3768d8 100644
--- a/src/filters/reader/CDDAReader/stdafx.h
+++ b/src/filters/reader/CDDAReader/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/CDXAReader/CDXAReader.cpp b/src/filters/reader/CDXAReader/CDXAReader.cpp
index aa17fe3d6..099c56d45 100644
--- a/src/filters/reader/CDXAReader/CDXAReader.cpp
+++ b/src/filters/reader/CDXAReader/CDXAReader.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -28,8 +28,7 @@
/////////
-static DWORD EDC_crctable[256] =
-{
+static DWORD EDC_crctable[256] = {
0x00000000l, 0x90910101l, 0x91210201l, 0x01b00300l,
0x92410401l, 0x02d00500l, 0x03600600l, 0x93f10701l,
0x94810801l, 0x04100900l, 0x05a00a00l, 0x95310b01l,
@@ -101,9 +100,10 @@ static DWORD build_edc(const void* in, unsigned from, unsigned upto)
const BYTE* p = (BYTE*)in + from;
DWORD result = 0;
- for(; from < upto; from++)
+ for(; from < upto; from++) {
result = EDC_crctable[(result ^ *p++) & 0xffL] ^ (result >> 8);
-
+ }
+
return result;
}
@@ -111,23 +111,19 @@ static DWORD build_edc(const void* in, unsigned from, unsigned upto)
#ifdef REGISTER_FILTER
-const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
-{
+const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
{&MEDIATYPE_Stream, &MEDIASUBTYPE_NULL}
};
-const AMOVIESETUP_PIN sudOpPin[] =
-{
+const AMOVIESETUP_PIN sudOpPin[] = {
{L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesOut), sudPinTypesOut}
};
-const AMOVIESETUP_FILTER sudFilter[] =
-{
+const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CCDXAReader), L"MPC - CDXA Reader", MERIT_NORMAL, countof(sudOpPin), sudOpPin, CLSID_LegacyAmFilterCategory}
};
-CFactoryTemplate g_Templates[] =
-{
+CFactoryTemplate g_Templates[] = {
{sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CCDXAReader>, NULL, &sudFilter[0]}
};
@@ -136,11 +132,11 @@ int g_cTemplates = countof(g_Templates);
STDAPI DllRegisterServer()
{
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{D367878E-F3B8-4235-A968-F378EF1B9A44}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{D367878E-F3B8-4235-A968-F378EF1B9A44}"),
_T("0"), _T("0,4,,52494646,8,4,,43445841")); // "RIFFxxxxCDXA"
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{D367878E-F3B8-4235-A968-F378EF1B9A44}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{D367878E-F3B8-4235-A968-F378EF1B9A44}"),
_T("Source Filter"), _T("{D367878E-F3B8-4235-A968-F378EF1B9A44}"));
return AMovieDllRegisterServer2(TRUE);
@@ -166,7 +162,9 @@ CFilterApp theApp;
CCDXAReader::CCDXAReader(IUnknown* pUnk, HRESULT* phr)
: CAsyncReader(NAME("CCDXAReader"), pUnk, &m_stream, phr, __uuidof(this))
{
- if(phr) *phr = S_OK;
+ if(phr) {
+ *phr = S_OK;
+ }
}
CCDXAReader::~CCDXAReader()
@@ -175,18 +173,19 @@ CCDXAReader::~CCDXAReader()
STDMETHODIMP CCDXAReader::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- return
+ return
QI(IFileSourceFilter)
__super::NonDelegatingQueryInterface(riid, ppv);
}
-STDMETHODIMP CCDXAReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE *pmt)
+STDMETHODIMP CCDXAReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE *pmt)
{
CMediaType mt;
m_mt = mt;
- if(!m_stream.Load(pszFileName))
+ if(!m_stream.Load(pszFileName)) {
return E_FAIL;
+ }
m_fn = pszFileName;
@@ -199,11 +198,14 @@ STDMETHODIMP CCDXAReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE *pmt)
STDMETHODIMP CCDXAReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
{
- if(!ppszFileName) return E_POINTER;
+ if(!ppszFileName) {
+ return E_POINTER;
+ }
*ppszFileName = (LPOLESTR)CoTaskMemAlloc((m_fn.GetLength()+1)*sizeof(WCHAR));
- if(!(*ppszFileName))
+ if(!(*ppszFileName)) {
return E_OUTOFMEMORY;
+ }
wcscpy(*ppszFileName, m_fn);
@@ -215,7 +217,7 @@ STDMETHODIMP CCDXAReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
CCDXAStream::CCDXAStream()
{
m_subtype = MEDIASUBTYPE_NULL;
-
+
m_hFile = INVALID_HANDLE_VALUE;
m_llPosition = m_llLength = 0;
@@ -225,8 +227,7 @@ CCDXAStream::CCDXAStream()
CCDXAStream::~CCDXAStream()
{
- if(m_hFile != INVALID_HANDLE_VALUE)
- {
+ if(m_hFile != INVALID_HANDLE_VALUE) {
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
}
@@ -234,25 +235,22 @@ CCDXAStream::~CCDXAStream()
bool CCDXAStream::Load(const WCHAR* fnw)
{
- if(m_hFile != INVALID_HANDLE_VALUE)
- {
+ if(m_hFile != INVALID_HANDLE_VALUE) {
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
}
- m_hFile = CreateFile(CString(fnw), GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_READONLY|FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
- if(m_hFile == INVALID_HANDLE_VALUE)
- {
+ m_hFile = CreateFile(CString(fnw), GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_READONLY|FILE_FLAG_SEQUENTIAL_SCAN, (HANDLE)NULL);
+ if(m_hFile == INVALID_HANDLE_VALUE) {
return(false);
}
BYTE hdr[RIFFCDXA_HEADER_SIZE];
DWORD NumberOfBytesRead;
if(!ReadFile(m_hFile, (LPVOID)hdr, RIFFCDXA_HEADER_SIZE, &NumberOfBytesRead, NULL)
- || *((DWORD*)&hdr[0]) != 'FFIR' || *((DWORD*)&hdr[8]) != 'AXDC'
- || *((DWORD*)&hdr[4]) != (*((DWORD*)&hdr[0x28])+0x24))
- {
+ || *((DWORD*)&hdr[0]) != 'FFIR' || *((DWORD*)&hdr[8]) != 'AXDC'
+ || *((DWORD*)&hdr[4]) != (*((DWORD*)&hdr[0x28])+0x24)) {
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
return(false);
@@ -263,8 +261,7 @@ bool CCDXAStream::Load(const WCHAR* fnw)
m_llLength = int((size.QuadPart - RIFFCDXA_HEADER_SIZE) / RAW_SECTOR_SIZE) * RAW_DATA_SIZE;
- if(!LookForMediaSubType())
- {
+ if(!LookForMediaSubType()) {
m_llPosition = m_llLength = 0;
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
@@ -290,13 +287,11 @@ HRESULT CCDXAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
PBYTE pbBufferOrg = pbBuffer;
LONGLONG pos = m_llPosition;
- while(pos >= 0 && pos < m_llLength && dwBytesToRead > 0)
- {
+ while(pos >= 0 && pos < m_llLength && dwBytesToRead > 0) {
UINT sector = m_nFirstSector + int(pos/RAW_DATA_SIZE);
__int64 offset = pos%RAW_DATA_SIZE;
- if(m_nBufferedSector != (int)sector)
- {
+ if(m_nBufferedSector != (int)sector) {
LARGE_INTEGER FilePointer;
FilePointer.QuadPart = RIFFCDXA_HEADER_SIZE + sector*RAW_SECTOR_SIZE;
SetFilePointer(m_hFile, (LONG)FilePointer.LowPart, (PLONG)&FilePointer.HighPart, FILE_BEGIN);
@@ -306,18 +301,20 @@ HRESULT CCDXAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
DWORD NumberOfBytesRead = 0;
int nRetries = 3;
- while(nRetries--)
- {
+ while(nRetries--) {
NumberOfBytesRead = 0;
if(!ReadFile(m_hFile, m_sector, RAW_SECTOR_SIZE, &NumberOfBytesRead, NULL)
- || NumberOfBytesRead != RAW_SECTOR_SIZE)
+ || NumberOfBytesRead != RAW_SECTOR_SIZE) {
break;
+ }
- if(*(DWORD*)&m_sector[RAW_SECTOR_SIZE-4] == 0) // no CRC? it happens...
+ if(*(DWORD*)&m_sector[RAW_SECTOR_SIZE-4] == 0) { // no CRC? it happens...
break;
+ }
- if(build_edc(m_sector, RAW_SYNC_SIZE + RAW_HEADER_SIZE, RAW_SECTOR_SIZE) == 0)
+ if(build_edc(m_sector, RAW_SYNC_SIZE + RAW_HEADER_SIZE, RAW_SECTOR_SIZE) == 0) {
break;
+ }
TRACE(_T("CCDXAStream: CRC error at sector %d (fp=0x%I64x, retriesleft=%d)\n"), sector, FilePointer.QuadPart, nRetries);
}
@@ -333,33 +330,39 @@ HRESULT CCDXAStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDW
dwBytesToRead -= l;
}
- if(pdwBytesRead) *pdwBytesRead = pbBuffer - pbBufferOrg;
+ if(pdwBytesRead) {
+ *pdwBytesRead = pbBuffer - pbBufferOrg;
+ }
m_llPosition += pbBuffer - pbBufferOrg;
- if(dwBytesToRead != 0) return S_FALSE;
+ if(dwBytesToRead != 0) {
+ return S_FALSE;
+ }
return S_OK;
}
LONGLONG CCDXAStream::Size(LONGLONG* pSizeAvailable)
{
- if(pSizeAvailable) *pSizeAvailable = m_llLength;
- return m_llLength;
+ if(pSizeAvailable) {
+ *pSizeAvailable = m_llLength;
+ }
+ return m_llLength;
}
DWORD CCDXAStream::Alignment()
{
- return 1;
+ return 1;
}
void CCDXAStream::Lock()
{
- m_csLock.Lock();
+ m_csLock.Lock();
}
void CCDXAStream::Unlock()
{
- m_csLock.Unlock();
+ m_csLock.Unlock();
}
//
@@ -373,22 +376,21 @@ bool CCDXAStream::LookForMediaSubType()
m_llPosition = 0;
for(int iSectorsRead = 0;
- Read(buff, RAW_DATA_SIZE, 1, NULL) == S_OK && iSectorsRead < 1000;
- iSectorsRead++)
- {
- if(*((DWORD*)&buff[0]) == 0xba010000)
- {
+ Read(buff, RAW_DATA_SIZE, 1, NULL) == S_OK && iSectorsRead < 1000;
+ iSectorsRead++) {
+ if(*((DWORD*)&buff[0]) == 0xba010000) {
m_llPosition = 0;
m_llLength -= iSectorsRead*RAW_DATA_SIZE;
m_nFirstSector = iSectorsRead;
- if((buff[4]&0xc4) == 0x44) m_subtype = MEDIASUBTYPE_MPEG2_PROGRAM;
- else if((buff[4]&0xf1) == 0x21) m_subtype = MEDIASUBTYPE_MPEG1System;
+ if((buff[4]&0xc4) == 0x44) {
+ m_subtype = MEDIASUBTYPE_MPEG2_PROGRAM;
+ } else if((buff[4]&0xf1) == 0x21) {
+ m_subtype = MEDIASUBTYPE_MPEG1System;
+ }
return m_subtype != MEDIASUBTYPE_NULL;
- }
- else if(*((DWORD*)&buff[0]) == 'SggO')
- {
+ } else if(*((DWORD*)&buff[0]) == 'SggO') {
m_llPosition = 0;
m_llLength -= iSectorsRead*RAW_DATA_SIZE;
m_nFirstSector = iSectorsRead;
@@ -396,9 +398,7 @@ bool CCDXAStream::LookForMediaSubType()
m_subtype = MEDIASUBTYPE_Ogg;
return(true);
- }
- else if(*((DWORD*)&buff[0]) == 0xA3DF451A)
- {
+ } else if(*((DWORD*)&buff[0]) == 0xA3DF451A) {
m_llPosition = 0;
m_llLength -= iSectorsRead*RAW_DATA_SIZE;
m_nFirstSector = iSectorsRead;
@@ -406,9 +406,7 @@ bool CCDXAStream::LookForMediaSubType()
m_subtype = MEDIASUBTYPE_Matroska;
return(true);
- }
- else if(*((DWORD*)&buff[0]) == 'FMR.')
- {
+ } else if(*((DWORD*)&buff[0]) == 'FMR.') {
m_llPosition = 0;
m_llLength -= iSectorsRead*RAW_DATA_SIZE;
m_nFirstSector = iSectorsRead;
@@ -416,26 +414,22 @@ bool CCDXAStream::LookForMediaSubType()
m_subtype = MEDIASUBTYPE_RealMedia;
return(true);
- }
- else if(*((DWORD*)&buff[0]) == 'FFIR' && *((DWORD*)&buff[8]) == ' IVA')
- {
+ } else if(*((DWORD*)&buff[0]) == 'FFIR' && *((DWORD*)&buff[8]) == ' IVA') {
m_llPosition = 0;
m_llLength = min(m_llLength, *((DWORD*)&buff[4])+8);
m_nFirstSector = iSectorsRead;
m_subtype = MEDIASUBTYPE_Avi;
-
+
return(true);
- }
- else if(*((DWORD*)&buff[4]) == 'voom' || *((DWORD*)&buff[4]) == 'tadm'
- || *((DWORD*)&buff[4]) == 'pytf' && *((DWORD*)&buff[8]) == 'mosi' && *((DWORD*)&buff[16]) == '14pm')
- {
+ } else if(*((DWORD*)&buff[4]) == 'voom' || *((DWORD*)&buff[4]) == 'tadm'
+ || *((DWORD*)&buff[4]) == 'pytf' && *((DWORD*)&buff[8]) == 'mosi' && *((DWORD*)&buff[16]) == '14pm') {
m_llPosition = 0;
m_llLength -= iSectorsRead*RAW_DATA_SIZE;
m_nFirstSector = iSectorsRead;
m_subtype = MEDIASUBTYPE_QTMovie;
-
+
return(true);
}
}
@@ -444,25 +438,24 @@ bool CCDXAStream::LookForMediaSubType()
CRegKey majorkey;
CString majortype = _T("\\Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}");
- if(ERROR_SUCCESS == majorkey.Open(HKEY_CLASSES_ROOT, majortype, KEY_READ))
- {
+ if(ERROR_SUCCESS == majorkey.Open(HKEY_CLASSES_ROOT, majortype, KEY_READ)) {
TCHAR subtype[256+1];
DWORD len = 256;
- for(int i = 0; ERROR_SUCCESS == majorkey.EnumKey(i, subtype, &len); i++, len = 256)
- {
+ for(int i = 0; ERROR_SUCCESS == majorkey.EnumKey(i, subtype, &len); i++, len = 256) {
CRegKey subkey;
- if(ERROR_SUCCESS != subkey.Open(HKEY_CLASSES_ROOT, majortype + _T("\\") + subtype, KEY_READ))
+ if(ERROR_SUCCESS != subkey.Open(HKEY_CLASSES_ROOT, majortype + _T("\\") + subtype, KEY_READ)) {
continue;
+ }
- for(int j = 0; true; j++)
- {
+ for(int j = 0; true; j++) {
TCHAR number[10];
_stprintf(number, _T("%d"), j);
TCHAR pattern[256+1];
ULONG len = 256;
- if(ERROR_SUCCESS != subkey.QueryStringValue(number, pattern, &len))
+ if(ERROR_SUCCESS != subkey.QueryStringValue(number, pattern, &len)) {
break;
+ }
CString p = pattern;
p += ',';
@@ -473,59 +466,66 @@ bool CCDXAStream::LookForMediaSubType()
int nMatches = 0, nTries = 0;
- for(int k = 0, l; nTries >= 0 && (l = p.Find(',', k)) >= 0; k = l+1, nTries++)
- {
+ for(int k = 0, l; nTries >= 0 && (l = p.Find(',', k)) >= 0; k = l+1, nTries++) {
CString s = p.Mid(k, l-k);
TRACE(s + '\n');
TCHAR* end = NULL;
- switch(nTries&3)
- {
- case 0: offset = _tcstol(s, &end, 10); break;
- case 1: cb = _tcstol(s, &end, 10); break;
- case 2: CStringToBin(s, mask); break;
- case 3: CStringToBin(s, val); break;
- default: nTries = -1; break;
+ switch(nTries&3) {
+ case 0:
+ offset = _tcstol(s, &end, 10);
+ break;
+ case 1:
+ cb = _tcstol(s, &end, 10);
+ break;
+ case 2:
+ CStringToBin(s, mask);
+ break;
+ case 3:
+ CStringToBin(s, val);
+ break;
+ default:
+ nTries = -1;
+ break;
}
- if(nTries >= 0 && (nTries&3) == 3)
- {
- if(cb > 0 && val.GetCount() > 0 && cb == val.GetCount())
- {
+ if(nTries >= 0 && (nTries&3) == 3) {
+ if(cb > 0 && val.GetCount() > 0 && cb == val.GetCount()) {
if(offset >= 0 && S_OK == SetPointer(offset)
- || S_OK == SetPointer(m_llLength + offset))
- {
+ || S_OK == SetPointer(m_llLength + offset)) {
CAutoVectorPtr<BYTE> pData;
- if(pData.Allocate(cb))
- {
+ if(pData.Allocate(cb)) {
DWORD BytesRead = 0;
- if(S_OK == Read(pData, cb, 1, &BytesRead) && cb == BytesRead)
- {
- if(mask.GetCount() < cb)
- {
+ if(S_OK == Read(pData, cb, 1, &BytesRead) && cb == BytesRead) {
+ if(mask.GetCount() < cb) {
int i = mask.GetCount();
mask.SetCount(cb);
- for(; i < cb; i++) mask[i] = 0xff;
+ for(; i < cb; i++) {
+ mask[i] = 0xff;
+ }
}
- for(int i = 0; i < cb; i++)
+ for(int i = 0; i < cb; i++) {
pData[i] &= (BYTE)mask[i];
+ }
- if(memcmp(pData, val.GetData(), cb) == 0)
+ if(memcmp(pData, val.GetData(), cb) == 0) {
nMatches++;
+ }
}
}
}
- offset = 0; cb = 0;
- mask.RemoveAll(); val.RemoveAll();
+ offset = 0;
+ cb = 0;
+ mask.RemoveAll();
+ val.RemoveAll();
}
}
}
- if(nMatches > 0 && nMatches*4 == nTries)
- {
+ if(nMatches > 0 && nMatches*4 == nTries) {
m_subtype = GUIDFromCString(subtype);
return S_OK;
}
diff --git a/src/filters/reader/CDXAReader/CDXAReader.h b/src/filters/reader/CDXAReader/CDXAReader.h
index f923b9429..74dd1a2c2 100644
--- a/src/filters/reader/CDXAReader/CDXAReader.h
+++ b/src/filters/reader/CDXAReader/CDXAReader.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -28,8 +28,7 @@
class CCDXAStream : public CAsyncStream
{
private:
- enum
- {
+ enum {
RIFFCDXA_HEADER_SIZE = 44, // usually...
RAW_SYNC_SIZE = 12, // 00 FF .. FF 00
RAW_HEADER_SIZE = 4,
@@ -39,7 +38,7 @@ private:
RAW_SECTOR_SIZE = 2352
};
- CCritSec m_csLock;
+ CCritSec m_csLock;
HANDLE m_hFile;
LONGLONG m_llPosition, m_llLength;
@@ -56,18 +55,18 @@ public:
bool Load(const WCHAR* fnw);
- HRESULT SetPointer(LONGLONG llPos);
- HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
- LONGLONG Size(LONGLONG* pSizeAvailable);
- DWORD Alignment();
- void Lock();
+ HRESULT SetPointer(LONGLONG llPos);
+ HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
+ LONGLONG Size(LONGLONG* pSizeAvailable);
+ DWORD Alignment();
+ void Lock();
void Unlock();
GUID m_subtype;
};
class __declspec(uuid("D367878E-F3B8-4235-A968-F378EF1B9A44"))
-CCDXAReader
+ CCDXAReader
: public CAsyncReader
, public IFileSourceFilter
{
@@ -75,11 +74,11 @@ CCDXAReader
CStringW m_fn;
public:
- CCDXAReader(IUnknown* pUnk, HRESULT* phr);
+ CCDXAReader(IUnknown* pUnk, HRESULT* phr);
~CCDXAReader();
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
// IFileSourceFilter
STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt);
diff --git a/src/filters/reader/CDXAReader/stdafx.cpp b/src/filters/reader/CDXAReader/stdafx.cpp
index 13934d005..bea3f980a 100644
--- a/src/filters/reader/CDXAReader/stdafx.cpp
+++ b/src/filters/reader/CDXAReader/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/CDXAReader/stdafx.h b/src/filters/reader/CDXAReader/stdafx.h
index 62d50a36b..d1c3768d8 100644
--- a/src/filters/reader/CDXAReader/stdafx.h
+++ b/src/filters/reader/CDXAReader/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/UDPReader/UDPReader.cpp b/src/filters/reader/UDPReader/UDPReader.cpp
index d1fc5e25d..1fe035f6a 100644
--- a/src/filters/reader/UDPReader/UDPReader.cpp
+++ b/src/filters/reader/UDPReader/UDPReader.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -25,23 +25,19 @@
#ifdef REGISTER_FILTER
-const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
-{
+const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
{&MEDIATYPE_Stream, &MEDIASUBTYPE_NULL},
};
-const AMOVIESETUP_PIN sudOpPin[] =
-{
+const AMOVIESETUP_PIN sudOpPin[] = {
{L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesOut), sudPinTypesOut}
};
-const AMOVIESETUP_FILTER sudFilter[] =
-{
+const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CUDPReader), L"MPC - UDP Reader", MERIT_NORMAL, countof(sudOpPin), sudOpPin, CLSID_LegacyAmFilterCategory}
};
-CFactoryTemplate g_Templates[] =
-{
+CFactoryTemplate g_Templates[] = {
{sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CUDPReader>, NULL, &sudFilter[0]}
};
@@ -78,7 +74,9 @@ CFilterApp theApp;
CUDPReader::CUDPReader(IUnknown* pUnk, HRESULT* phr)
: CAsyncReader(NAME("CUDPReader"), pUnk, &m_stream, phr, __uuidof(this))
{
- if(phr) *phr = S_OK;
+ if(phr) {
+ *phr = S_OK;
+ }
}
CUDPReader::~CUDPReader()
@@ -87,19 +85,20 @@ CUDPReader::~CUDPReader()
STDMETHODIMP CUDPReader::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- CheckPointer(ppv, E_POINTER);
+ CheckPointer(ppv, E_POINTER);
- return
+ return
QI(IFileSourceFilter)
__super::NonDelegatingQueryInterface(riid, ppv);
}
// IFileSourceFilter
-STDMETHODIMP CUDPReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
+STDMETHODIMP CUDPReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
- if(!m_stream.Load(pszFileName))
+ if(!m_stream.Load(pszFileName)) {
return E_FAIL;
+ }
m_fn = pszFileName;
@@ -113,11 +112,14 @@ STDMETHODIMP CUDPReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
STDMETHODIMP CUDPReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
{
- if(!ppszFileName) return E_POINTER;
-
+ if(!ppszFileName) {
+ return E_POINTER;
+ }
+
*ppszFileName = (LPOLESTR)CoTaskMemAlloc((m_fn.GetLength()+1)*sizeof(WCHAR));
- if(!(*ppszFileName))
+ if(!(*ppszFileName)) {
return E_OUTOFMEMORY;
+ }
wcscpy(*ppszFileName, m_fn);
@@ -140,13 +142,17 @@ CUDPStream::~CUDPStream()
void CUDPStream::Clear()
{
- if(m_socket !=INVALID_SOCKET) {closesocket(m_socket); m_socket = INVALID_SOCKET;}
- if(CAMThread::ThreadExists())
- {
+ if(m_socket !=INVALID_SOCKET) {
+ closesocket(m_socket);
+ m_socket = INVALID_SOCKET;
+ }
+ if(CAMThread::ThreadExists()) {
CAMThread::CallWorker(CMD_EXIT);
CAMThread::Close();
}
- while(!m_packets.IsEmpty()) delete m_packets.RemoveHead();
+ while(!m_packets.IsEmpty()) {
+ delete m_packets.RemoveHead();
+ }
m_pos = m_len = 0;
m_drop = false;
}
@@ -155,22 +161,20 @@ void CUDPStream::Append(BYTE* buff, int len)
{
CAutoLock cAutoLock(&m_csLock);
- if(m_packets.GetCount() > 1)
- {
+ if(m_packets.GetCount() > 1) {
__int64 size = m_packets.GetTail()->m_end - m_packets.GetHead()->m_start;
- if(!m_drop && (m_pos >= BUFF_SIZE_FIRST && size >= BUFF_SIZE_FIRST || size >= 2*BUFF_SIZE_FIRST))
- {
+ if(!m_drop && (m_pos >= BUFF_SIZE_FIRST && size >= BUFF_SIZE_FIRST || size >= 2*BUFF_SIZE_FIRST)) {
m_drop = true;
TRACE(_T("DROP ON\n"));
- }
- else if(m_drop && size <= BUFF_SIZE_FIRST)
- {
+ } else if(m_drop && size <= BUFF_SIZE_FIRST) {
m_drop = false;
TRACE(_T("DROP OFF\n"));
}
-
- if(m_drop) return;
+
+ if(m_drop) {
+ return;
+ }
}
m_packets.AddTail(DNew packet_t(buff, m_len, m_len + len));
@@ -184,14 +188,16 @@ bool CUDPStream::Load(const WCHAR* fnw)
CStringW url = CStringW(fnw);
#ifdef DEBUG
-// url = L"udp://:1234/";
-// url = L"udp://239.255.255.250:1234/{e436eb8e-524f-11ce-9f53-0020af0ba770}";
-// url = L"udp://239.255.255.19:2345/";
+ // url = L"udp://:1234/";
+ // url = L"udp://239.255.255.250:1234/{e436eb8e-524f-11ce-9f53-0020af0ba770}";
+ // url = L"udp://239.255.255.19:2345/";
#endif
CAtlList<CStringW> sl;
Explode(url, sl, ':');
- if(sl.GetCount() != 3) return false;
+ if(sl.GetCount() != 3) {
+ return false;
+ }
CStringW protocol = sl.RemoveHead();
// if(protocol != L"udp") return false;
@@ -199,22 +205,25 @@ bool CUDPStream::Load(const WCHAR* fnw)
m_ip = CString(sl.RemoveHead()).TrimLeft('/');
int port = _wtoi(Explode(sl.RemoveHead(), sl, '/', 2));
- if(port < 0 || port > 0xffff) return false;
+ if(port < 0 || port > 0xffff) {
+ return false;
+ }
m_port = port;
- if(sl.GetCount() != 2 || FAILED(GUIDFromCString(CString(sl.GetTail()), m_subtype)))
- m_subtype = MEDIASUBTYPE_NULL; // TODO: detect subtype
+ if(sl.GetCount() != 2 || FAILED(GUIDFromCString(CString(sl.GetTail()), m_subtype))) {
+ m_subtype = MEDIASUBTYPE_NULL; // TODO: detect subtype
+ }
CAMThread::Create();
- if(FAILED(CAMThread::CallWorker(CMD_RUN)))
- {
+ if(FAILED(CAMThread::CallWorker(CMD_RUN))) {
Clear();
return false;
}
clock_t start = clock();
- while(clock() - start < 3000 && m_len < 1000000)
+ while(clock() - start < 3000 && m_len < 1000000) {
Sleep(100);
+ }
return true;
}
@@ -224,9 +233,8 @@ HRESULT CUDPStream::SetPointer(LONGLONG llPos)
CAutoLock cAutoLock(&m_csLock);
if(m_packets.IsEmpty() && llPos != 0
- || !m_packets.IsEmpty() && llPos < m_packets.GetHead()->m_start
- || !m_packets.IsEmpty() && llPos > m_packets.GetTail()->m_end)
- {
+ || !m_packets.IsEmpty() && llPos < m_packets.GetHead()->m_start
+ || !m_packets.IsEmpty() && llPos > m_packets.GetTail()->m_end) {
TRACE(_T("CUDPStream: SetPointer error\n"));
return E_FAIL;
}
@@ -243,25 +251,19 @@ HRESULT CUDPStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
DWORD len = dwBytesToRead;
BYTE* ptr = pbBuffer;
- while(len > 0 && !m_packets.IsEmpty())
- {
+ while(len > 0 && !m_packets.IsEmpty()) {
POSITION pos = m_packets.GetHeadPosition();
- while(pos && len > 0)
- {
+ while(pos && len > 0) {
packet_t* p = m_packets.GetNext(pos);
- if(p->m_start <= m_pos && m_pos < p->m_end)
- {
+ if(p->m_start <= m_pos && m_pos < p->m_end) {
int size;
- if(m_pos < p->m_start)
- {
+ if(m_pos < p->m_start) {
ASSERT(0);
size = min(len, p->m_start - m_pos);
memset(ptr, 0, size);
- }
- else
- {
+ } else {
size = min(len, p->m_end - m_pos);
memcpy(ptr, &p->m_buff[m_pos - p->m_start], size);
}
@@ -272,17 +274,18 @@ HRESULT CUDPStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
len -= size;
}
- if(p->m_end <= m_pos - 2048 && BUFF_SIZE_FIRST <= m_pos)
- {
- while(m_packets.GetHeadPosition() != pos)
+ if(p->m_end <= m_pos - 2048 && BUFF_SIZE_FIRST <= m_pos) {
+ while(m_packets.GetHeadPosition() != pos) {
delete m_packets.RemoveHead();
+ }
}
}
}
- if(pdwBytesRead)
+ if(pdwBytesRead) {
*pdwBytesRead = ptr - pbBuffer;
+ }
return S_OK;
}
@@ -290,23 +293,25 @@ HRESULT CUDPStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
LONGLONG CUDPStream::Size(LONGLONG* pSizeAvailable)
{
CAutoLock cAutoLock(&m_csLock);
- if(pSizeAvailable) *pSizeAvailable = m_len;
+ if(pSizeAvailable) {
+ *pSizeAvailable = m_len;
+ }
return 0;
}
DWORD CUDPStream::Alignment()
{
- return 1;
+ return 1;
}
void CUDPStream::Lock()
{
- m_csLock.Lock();
+ m_csLock.Lock();
}
void CUDPStream::Unlock()
{
- m_csLock.Unlock();
+ m_csLock.Unlock();
}
DWORD CUDPStream::ThreadProc()
@@ -320,32 +325,30 @@ DWORD CUDPStream::ThreadProc()
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_port = htons((u_short)m_port);
- ip_mreq imr;
+ ip_mreq imr;
imr.imr_multiaddr.s_addr = inet_addr(CStringA(m_ip));
imr.imr_interface.s_addr = INADDR_ANY;
- if((m_socket = socket(AF_INET, SOCK_DGRAM, 0))!=INVALID_SOCKET)
- {
-/* u_long argp = 1;
- ioctlsocket(m_socket, FIONBIO, &argp);
-*/
+ if((m_socket = socket(AF_INET, SOCK_DGRAM, 0))!=INVALID_SOCKET) {
+ /* u_long argp = 1;
+ ioctlsocket(m_socket, FIONBIO, &argp);
+ */
DWORD dw = TRUE;
- if(setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&dw, sizeof(dw))==SOCKET_ERROR)
- {
+ if(setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (const char*)&dw, sizeof(dw))==SOCKET_ERROR) {
closesocket(m_socket);
m_socket = INVALID_SOCKET;
}
- if(bind(m_socket, (struct sockaddr*)&addr, sizeof(addr))==SOCKET_ERROR)
- {
+ if(bind(m_socket, (struct sockaddr*)&addr, sizeof(addr))==SOCKET_ERROR) {
closesocket(m_socket);
m_socket = INVALID_SOCKET;
}
- if(IN_MULTICAST(htonl(imr.imr_multiaddr.s_addr)))
- {
+ if(IN_MULTICAST(htonl(imr.imr_multiaddr.s_addr))) {
int ret = setsockopt(m_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const char*)&imr, sizeof(imr));
- if(ret < 0) ret = ::WSAGetLastError();
+ if(ret < 0) {
+ ret = ::WSAGetLastError();
+ }
ret = ret;
}
}
@@ -354,91 +357,96 @@ DWORD CUDPStream::ThreadProc()
#ifdef _DEBUG
FILE* dump = NULL;
-// dump = _tfopen(_T("c:\\udp.ts"), _T("wb"));
+ // dump = _tfopen(_T("c:\\udp.ts"), _T("wb"));
FILE* log = NULL;
-// log = _tfopen(_T("c:\\udp.txt"), _T("wt"));
+ // log = _tfopen(_T("c:\\udp.txt"), _T("wt"));
#endif
- while(1)
- {
+ while(1) {
DWORD cmd = GetRequest();
- switch(cmd)
- {
- default:
- case CMD_EXIT:
- if(m_socket!=INVALID_SOCKET) {closesocket(m_socket); m_socket = INVALID_SOCKET;}
- WSACleanup();
+ switch(cmd) {
+ default:
+ case CMD_EXIT:
+ if(m_socket!=INVALID_SOCKET) {
+ closesocket(m_socket);
+ m_socket = INVALID_SOCKET;
+ }
+ WSACleanup();
#ifdef _DEBUG
- if(dump) fclose(dump);
- if(log) fclose(log);
+ if(dump) {
+ fclose(dump);
+ }
+ if(log) {
+ fclose(log);
+ }
#endif
- Reply(S_OK);
- return 0;
- case CMD_RUN:
- Reply(m_socket!=INVALID_SOCKET ? S_OK : E_FAIL);
+ Reply(S_OK);
+ return 0;
+ case CMD_RUN:
+ Reply(m_socket!=INVALID_SOCKET ? S_OK : E_FAIL);
- {
- char buff[65536*2];
- int buffsize = 0;
-
- for(unsigned int i = 0; ; i++)
{
- if(!(i&0xff))
- {
- if(CheckRequest(NULL))
- break;
- }
+ char buff[65536*2];
+ int buffsize = 0;
- int fromlen = sizeof(addr);
- int len = recvfrom(m_socket, &buff[buffsize], 65536, 0, (SOCKADDR*)&addr, &fromlen);
- if(len <= 0) {Sleep(1); continue;}
+ for(unsigned int i = 0; ; i++) {
+ if(!(i&0xff)) {
+ if(CheckRequest(NULL)) {
+ break;
+ }
+ }
+
+ int fromlen = sizeof(addr);
+ int len = recvfrom(m_socket, &buff[buffsize], 65536, 0, (SOCKADDR*)&addr, &fromlen);
+ if(len <= 0) {
+ Sleep(1);
+ continue;
+ }
#ifdef _DEBUG
- if(log)
- {
- if(buffsize >= len && !memcmp(&buff[buffsize-len], &buff[buffsize], len))
- {
- DWORD pid = ((buff[buffsize+1]<<8)|buff[buffsize+2])&0x1fff;
- DWORD counter = buff[buffsize+3]&0xf;
- _ftprintf(log, _T("%04d %2d DUP\n"), pid, counter);
+ if(log) {
+ if(buffsize >= len && !memcmp(&buff[buffsize-len], &buff[buffsize], len)) {
+ DWORD pid = ((buff[buffsize+1]<<8)|buff[buffsize+2])&0x1fff;
+ DWORD counter = buff[buffsize+3]&0xf;
+ _ftprintf(log, _T("%04d %2d DUP\n"), pid, counter);
+ }
}
- }
#endif
- buffsize += len;
-
- if(buffsize >= 65536 || m_len == 0)
- {
+ buffsize += len;
+
+ if(buffsize >= 65536 || m_len == 0) {
#ifdef _DEBUG
- if(dump)
- {
- fwrite(buff, buffsize, 1, dump);
- }
+ if(dump) {
+ fwrite(buff, buffsize, 1, dump);
+ }
- if(log)
- {
- static BYTE pid2counter[0x2000];
- static bool init = false;
- if(!init) {memset(pid2counter, 0, sizeof(pid2counter)); init = true;}
-
- for(int i = 0; i < buffsize; i += 188)
- {
- DWORD pid = ((buff[i+1]<<8)|buff[i+2])&0x1fff;
- DWORD counter = buff[i+3]&0xf;
- if(pid2counter[pid] != ((counter-1+16)&15))
- _ftprintf(log, _T("%04x %2d -> %2d\n"), pid, pid2counter[pid], counter);
- pid2counter[pid] = counter;
+ if(log) {
+ static BYTE pid2counter[0x2000];
+ static bool init = false;
+ if(!init) {
+ memset(pid2counter, 0, sizeof(pid2counter));
+ init = true;
+ }
+
+ for(int i = 0; i < buffsize; i += 188) {
+ DWORD pid = ((buff[i+1]<<8)|buff[i+2])&0x1fff;
+ DWORD counter = buff[i+3]&0xf;
+ if(pid2counter[pid] != ((counter-1+16)&15)) {
+ _ftprintf(log, _T("%04x %2d -> %2d\n"), pid, pid2counter[pid], counter);
+ }
+ pid2counter[pid] = counter;
+ }
}
- }
#endif
- Append((BYTE*)buff, buffsize);
- buffsize = 0;
+ Append((BYTE*)buff, buffsize);
+ buffsize = 0;
+ }
}
}
- }
- break;
+ break;
}
}
@@ -446,7 +454,7 @@ DWORD CUDPStream::ThreadProc()
return (DWORD)-1;
}
-CUDPStream::packet_t::packet_t(BYTE* p, __int64 start, __int64 end)
+CUDPStream::packet_t::packet_t(BYTE* p, __int64 start, __int64 end)
: m_start(start)
, m_end(end)
{
diff --git a/src/filters/reader/UDPReader/UDPReader.h b/src/filters/reader/UDPReader/UDPReader.h
index 42f778e34..41cd86f03 100644
--- a/src/filters/reader/UDPReader/UDPReader.h
+++ b/src/filters/reader/UDPReader/UDPReader.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -28,15 +28,17 @@
class CUDPStream : public CAsyncStream, public CAMThread
{
private:
- CCritSec m_csLock;
+ CCritSec m_csLock;
class packet_t
{
public:
- BYTE* m_buff;
+ BYTE* m_buff;
__int64 m_start, m_end;
packet_t(BYTE* p, __int64 start, __int64 end);
- virtual ~packet_t() {delete [] m_buff;}
+ virtual ~packet_t() {
+ delete [] m_buff;
+ }
};
int m_port;
@@ -58,18 +60,20 @@ public:
virtual ~CUDPStream();
bool Load(const WCHAR* fnw);
- const GUID& GetSubType() {return m_subtype;}
+ const GUID& GetSubType() {
+ return m_subtype;
+ }
- HRESULT SetPointer(LONGLONG llPos);
- HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
- LONGLONG Size(LONGLONG* pSizeAvailable);
- DWORD Alignment();
- void Lock();
+ HRESULT SetPointer(LONGLONG llPos);
+ HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
+ LONGLONG Size(LONGLONG* pSizeAvailable);
+ DWORD Alignment();
+ void Lock();
void Unlock();
};
class __declspec(uuid("0E4221A9-9718-48D5-A5CF-4493DAD4A015"))
-CUDPReader
+ CUDPReader
: public CAsyncReader
, public IFileSourceFilter
{
@@ -77,11 +81,11 @@ CUDPReader
CStringW m_fn;
public:
- CUDPReader(IUnknown* pUnk, HRESULT* phr);
+ CUDPReader(IUnknown* pUnk, HRESULT* phr);
~CUDPReader();
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
// IFileSourceFilter
STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt);
diff --git a/src/filters/reader/UDPReader/stdafx.cpp b/src/filters/reader/UDPReader/stdafx.cpp
index 13934d005..bea3f980a 100644
--- a/src/filters/reader/UDPReader/stdafx.cpp
+++ b/src/filters/reader/UDPReader/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/UDPReader/stdafx.h b/src/filters/reader/UDPReader/stdafx.h
index e39f2d6f1..934cd148d 100644
--- a/src/filters/reader/UDPReader/stdafx.h
+++ b/src/filters/reader/UDPReader/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/VTSReader/VTSReader.cpp b/src/filters/reader/VTSReader/VTSReader.cpp
index 9fb53e679..424cc1b90 100644
--- a/src/filters/reader/VTSReader/VTSReader.cpp
+++ b/src/filters/reader/VTSReader/VTSReader.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -26,23 +26,19 @@
#ifdef REGISTER_FILTER
-const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] =
-{
+const AMOVIESETUP_MEDIATYPE sudPinTypesOut[] = {
{&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG2_PROGRAM},
};
-const AMOVIESETUP_PIN sudOpPin[] =
-{
+const AMOVIESETUP_PIN sudOpPin[] = {
{L"Output", FALSE, TRUE, FALSE, FALSE, &CLSID_NULL, NULL, countof(sudPinTypesOut), sudPinTypesOut}
};
-const AMOVIESETUP_FILTER sudFilter[] =
-{
+const AMOVIESETUP_FILTER sudFilter[] = {
{&__uuidof(CVTSReader), L"MPC - VTS Reader", MERIT_NORMAL, countof(sudOpPin), sudOpPin, CLSID_LegacyAmFilterCategory}
};
-CFactoryTemplate g_Templates[] =
-{
+CFactoryTemplate g_Templates[] = {
{sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CVTSReader>, NULL, &sudFilter[0]}
};
@@ -50,15 +46,16 @@ int g_cTemplates = countof(g_Templates);
STDAPI DllRegisterServer()
{
- if(GetVersion()&0x80000000)
+ if(GetVersion()&0x80000000) {
return E_NOTIMPL;
+ }
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}"),
_T("0"), _T("0,12,,445644564944454F2D565453")); // "DVDVIDEO-VTS"
SetRegKeyValue(
- _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}"),
+ _T("Media Type\\{e436eb83-524f-11ce-9f53-0020af0ba770}"), _T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}"),
_T("Source Filter"), _T("{773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73}"));
return AMovieDllRegisterServer2(TRUE);
@@ -84,11 +81,14 @@ CFilterApp theApp;
CVTSReader::CVTSReader(IUnknown* pUnk, HRESULT* phr)
: CAsyncReader(NAME("CVTSReader"), pUnk, &m_stream, phr, __uuidof(this))
{
- if(phr) *phr = S_OK;
+ if(phr) {
+ *phr = S_OK;
+ }
- if(GetVersion()&0x80000000)
- {
- if(phr) *phr = E_NOTIMPL;
+ if(GetVersion()&0x80000000) {
+ if(phr) {
+ *phr = E_NOTIMPL;
+ }
return;
}
}
@@ -99,19 +99,20 @@ CVTSReader::~CVTSReader()
STDMETHODIMP CVTSReader::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
- CheckPointer(ppv, E_POINTER);
+ CheckPointer(ppv, E_POINTER);
- return
+ return
QI(IFileSourceFilter)
__super::NonDelegatingQueryInterface(riid, ppv);
}
// IFileSourceFilter
-STDMETHODIMP CVTSReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
+STDMETHODIMP CVTSReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
- if(!m_stream.Load(pszFileName))
+ if(!m_stream.Load(pszFileName)) {
return E_FAIL;
+ }
m_fn = pszFileName;
@@ -125,11 +126,14 @@ STDMETHODIMP CVTSReader::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
STDMETHODIMP CVTSReader::GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt)
{
- if(!ppszFileName) return E_POINTER;
-
+ if(!ppszFileName) {
+ return E_POINTER;
+ }
+
*ppszFileName = (LPOLESTR)CoTaskMemAlloc((m_fn.GetLength()+1)*sizeof(WCHAR));
- if(!(*ppszFileName))
+ if(!(*ppszFileName)) {
return E_OUTOFMEMORY;
+ }
wcscpy(*ppszFileName, m_fn);
@@ -168,11 +172,11 @@ HRESULT CVTSStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
DWORD len = dwBytesToRead;
BYTE* ptr = pbBuffer;
- while(len > 0)
- {
+ while(len > 0) {
BYTE buff[2048];
- if(!m_vob->Read(buff))
+ if(!m_vob->Read(buff)) {
break;
+ }
int size = min(2048 - m_off, min(len, 2048));
@@ -180,15 +184,17 @@ HRESULT CVTSStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
m_off = (m_off + size)&2047;
- if(m_off > 0)
+ if(m_off > 0) {
m_vob->Seek(m_vob->GetPosition()-1);
+ }
ptr += size;
len -= size;
}
- if(pdwBytesRead)
+ if(pdwBytesRead) {
*pdwBytesRead = ptr - pbBuffer;
+ }
return S_OK;
}
@@ -196,22 +202,24 @@ HRESULT CVTSStream::Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWO
LONGLONG CVTSStream::Size(LONGLONG* pSizeAvailable)
{
LONGLONG len = 2048i64*m_vob->GetLength();
- if(pSizeAvailable) *pSizeAvailable = len;
+ if(pSizeAvailable) {
+ *pSizeAvailable = len;
+ }
return(len);
}
DWORD CVTSStream::Alignment()
{
- return 1;
+ return 1;
}
void CVTSStream::Lock()
{
- m_csLock.Lock();
+ m_csLock.Lock();
}
void CVTSStream::Unlock()
{
- m_csLock.Unlock();
+ m_csLock.Unlock();
}
diff --git a/src/filters/reader/VTSReader/VTSReader.h b/src/filters/reader/VTSReader/VTSReader.h
index 4326f43aa..bbd963cab 100644
--- a/src/filters/reader/VTSReader/VTSReader.h
+++ b/src/filters/reader/VTSReader/VTSReader.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -30,7 +30,7 @@ class CVobFile;
class CVTSStream : public CAsyncStream
{
private:
- CCritSec m_csLock;
+ CCritSec m_csLock;
CAutoPtr<CVobFile> m_vob;
int m_off;
@@ -41,16 +41,16 @@ public:
bool Load(const WCHAR* fnw);
- HRESULT SetPointer(LONGLONG llPos);
- HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
- LONGLONG Size(LONGLONG* pSizeAvailable);
- DWORD Alignment();
- void Lock();
+ HRESULT SetPointer(LONGLONG llPos);
+ HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
+ LONGLONG Size(LONGLONG* pSizeAvailable);
+ DWORD Alignment();
+ void Lock();
void Unlock();
};
class __declspec(uuid("773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73"))
-CVTSReader
+ CVTSReader
: public CAsyncReader
, public IFileSourceFilter
{
@@ -58,11 +58,11 @@ CVTSReader
CStringW m_fn;
public:
- CVTSReader(IUnknown* pUnk, HRESULT* phr);
+ CVTSReader(IUnknown* pUnk, HRESULT* phr);
~CVTSReader();
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
// IFileSourceFilter
STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt);
diff --git a/src/filters/reader/VTSReader/stdafx.cpp b/src/filters/reader/VTSReader/stdafx.cpp
index 13934d005..bea3f980a 100644
--- a/src/filters/reader/VTSReader/stdafx.cpp
+++ b/src/filters/reader/VTSReader/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/src/filters/reader/VTSReader/stdafx.h b/src/filters/reader/VTSReader/stdafx.h
index 6188a0bd8..d8d4e35e7 100644
--- a/src/filters/reader/VTSReader/stdafx.h
+++ b/src/filters/reader/VTSReader/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.