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:
authortetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
commita9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch)
tree2dab453d94d5e003379a6cc895eceb84c80e23ec /src/filters/misc/SyncClock
parentaafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff)
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren http://astyle.sourceforge.net/ git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/misc/SyncClock')
-rw-r--r--src/filters/misc/SyncClock/Interfaces.h11
-rw-r--r--src/filters/misc/SyncClock/SyncClock.cpp71
-rw-r--r--src/filters/misc/SyncClock/SyncClock.h34
-rw-r--r--src/filters/misc/SyncClock/resource.h2
-rw-r--r--src/filters/misc/SyncClock/stdafx.cpp8
-rw-r--r--src/filters/misc/SyncClock/stdafx.h8
6 files changed, 67 insertions, 67 deletions
diff --git a/src/filters/misc/SyncClock/Interfaces.h b/src/filters/misc/SyncClock/Interfaces.h
index a4bff0b25..3d23d2075 100644
--- a/src/filters/misc/SyncClock/Interfaces.h
+++ b/src/filters/misc/SyncClock/Interfaces.h
@@ -3,11 +3,12 @@
const IID IID_ISyncClock = {0xa62888fb, 0x8e37, 0x44d2, {0x88, 0x50, 0xb3, 0xe3, 0xf2, 0xc1, 0x16, 0x9f}};
MIDL_INTERFACE("A62888FB-8E37-44d2-8850-B3E3F2C1169F")
-ISyncClock: public IUnknown
+ISyncClock:
+public IUnknown
{
public:
- virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
- virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetStartTime(REFERENCE_TIME *startTime);
+ virtual HRESULT STDMETHODCALLTYPE AdjustClock(DOUBLE adjustment) = 0;
+ virtual HRESULT STDMETHODCALLTYPE SetBias(DOUBLE bias) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetBias(DOUBLE *bias) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetStartTime(REFERENCE_TIME *startTime);
};
diff --git a/src/filters/misc/SyncClock/SyncClock.cpp b/src/filters/misc/SyncClock/SyncClock.cpp
index 51743b592..a351a5273 100644
--- a/src/filters/misc/SyncClock/SyncClock.cpp
+++ b/src/filters/misc/SyncClock/SyncClock.cpp
@@ -10,12 +10,12 @@
const AMOVIESETUP_FILTER sudFilter[] =
{
- {&__uuidof(CSyncClockFilter), L"SyncClock", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory}
+ {&__uuidof(CSyncClockFilter), L"SyncClock", MERIT_NORMAL, 0, NULL, CLSID_LegacyAmFilterCategory}
};
CFactoryTemplate g_Templates[] =
{
- {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSyncClockFilter>, NULL, &sudFilter[0]}
+ {sudFilter[0].strName, sudFilter[0].clsID, CreateInstance<CSyncClockFilter>, NULL, &sudFilter[0]}
};
int g_cTemplates = countof(g_Templates);
@@ -37,8 +37,8 @@ CFilterApp theApp;
#endif
CSyncClockFilter::CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr)
- : CBaseFilter(NAME("SyncClock"), NULL, &m_Lock, CLSID_NULL)
- , m_Clock(static_cast<IBaseFilter*>(this), phr)
+ : CBaseFilter(NAME("SyncClock"), NULL, &m_Lock, CLSID_NULL)
+ , m_Clock(static_cast<IBaseFilter*>(this), phr)
{
}
@@ -48,30 +48,30 @@ CSyncClockFilter::~CSyncClockFilter()
STDMETHODIMP CSyncClockFilter::AdjustClock(DOUBLE adjustment)
{
- m_Clock.adjustment = adjustment;
- return S_OK;
+ m_Clock.adjustment = adjustment;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::SetBias(DOUBLE bias)
{
- m_Clock.bias = bias;
- return S_OK;
+ m_Clock.bias = bias;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::GetBias(DOUBLE *bias)
{
- *bias = m_Clock.bias;
- return S_OK;
+ *bias = m_Clock.bias;
+ return S_OK;
}
STDMETHODIMP CSyncClockFilter::GetStartTime(REFERENCE_TIME *startTime)
{
- *startTime = m_tStart;
- return S_OK;
+ *startTime = m_tStart;
+ return S_OK;
}
-STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface( REFIID riid, void ** ppv )
+STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface(REFIID riid, void ** ppv)
{
CheckPointer(ppv, E_POINTER);
@@ -79,13 +79,12 @@ STDMETHODIMP CSyncClockFilter::NonDelegatingQueryInterface( REFIID riid, void **
{
return GetInterface(static_cast<IReferenceClock*>(&m_Clock), ppv);
}
- else
- if(riid == IID_ISyncClock)
+ else if(riid == IID_ISyncClock)
{
return GetInterface(static_cast<ISyncClock*>(this), ppv);
}
- else
- {
+ else
+ {
return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
}
}
@@ -103,39 +102,39 @@ CBasePin *CSyncClockFilter::GetPin(int i)
// CSyncClock methods
CSyncClock::CSyncClock(LPUNKNOWN pUnk, HRESULT *phr)
- : CBaseReferenceClock(NAME("SyncClock"), pUnk, phr)
- , m_pCurrentRefClock(0), m_pPrevRefClock(0)
+ : CBaseReferenceClock(NAME("SyncClock"), pUnk, phr)
+ , m_pCurrentRefClock(0), m_pPrevRefClock(0)
{
- QueryPerformanceFrequency((LARGE_INTEGER*)&m_llPerfFrequency);
+ QueryPerformanceFrequency((LARGE_INTEGER*)&m_llPerfFrequency);
m_rtPrivateTime = GetTicks100ns();
m_rtPrevTime = m_rtPrivateTime;
- adjustment = 1.0;
- bias = 1.0;
+ adjustment = 1.0;
+ bias = 1.0;
}
REFERENCE_TIME CSyncClock::GetPrivateTime()
{
CAutoLock cObjectLock(this);
- REFERENCE_TIME rtTime = GetTicks100ns();
+ REFERENCE_TIME rtTime = GetTicks100ns();
- REFERENCE_TIME delta = rtTime - m_rtPrevTime;
- // We ignore that rtTime may wrap around. Not gonna happen too often
- m_rtPrevTime = rtTime;
+ REFERENCE_TIME delta = rtTime - m_rtPrevTime;
+ // We ignore that rtTime may wrap around. Not gonna happen too often
+ m_rtPrevTime = rtTime;
- delta = (REFERENCE_TIME)((DOUBLE)delta * adjustment * bias);
- m_rtPrivateTime = m_rtPrivateTime + delta;
+ delta = (REFERENCE_TIME)((DOUBLE)delta * adjustment * bias);
+ m_rtPrivateTime = m_rtPrivateTime + delta;
return m_rtPrivateTime;
}
REFERENCE_TIME CSyncClock::GetTicks100ns()
{
- LONGLONG i64Ticks100ns;
- if (m_llPerfFrequency != 0)
- {
- QueryPerformanceCounter((LARGE_INTEGER*)&i64Ticks100ns);
- i64Ticks100ns = LONGLONG((double(i64Ticks100ns) * 10000000) / double(m_llPerfFrequency) + 0.5);
- return (REFERENCE_TIME)i64Ticks100ns;
- }
- return 0;
+ LONGLONG i64Ticks100ns;
+ if(m_llPerfFrequency != 0)
+ {
+ QueryPerformanceCounter((LARGE_INTEGER*)&i64Ticks100ns);
+ i64Ticks100ns = LONGLONG((double(i64Ticks100ns) * 10000000) / double(m_llPerfFrequency) + 0.5);
+ return (REFERENCE_TIME)i64Ticks100ns;
+ }
+ return 0;
}
diff --git a/src/filters/misc/SyncClock/SyncClock.h b/src/filters/misc/SyncClock/SyncClock.h
index 54bef1292..d6b591bcd 100644
--- a/src/filters/misc/SyncClock/SyncClock.h
+++ b/src/filters/misc/SyncClock/SyncClock.h
@@ -12,22 +12,22 @@ class CSyncClock: public CBaseReferenceClock
public:
CSyncClock(LPUNKNOWN pUnk, HRESULT *phr);
- REFERENCE_TIME GetPrivateTime();
- IUnknown * pUnk()
+ REFERENCE_TIME GetPrivateTime();
+ IUnknown * pUnk()
{
- return static_cast<IUnknown*>(static_cast<IReferenceClock*>(this));
- }
- DOUBLE adjustment; // For adjusting speed temporarily
- DOUBLE bias; // For changing speed permanently
+ return static_cast<IUnknown*>(static_cast<IReferenceClock*>(this));
+ }
+ DOUBLE adjustment; // For adjusting speed temporarily
+ DOUBLE bias; // For changing speed permanently
private:
REFERENCE_TIME m_rtPrivateTime;
- LONGLONG m_llPerfFrequency;
- REFERENCE_TIME m_rtPrevTime;
+ LONGLONG m_llPerfFrequency;
+ REFERENCE_TIME m_rtPrevTime;
CCritSec m_csClock;
IReferenceClock * m_pCurrentRefClock;
IReferenceClock * m_pPrevRefClock;
- REFERENCE_TIME GetTicks100ns();
+ REFERENCE_TIME GetTicks100ns();
};
[uuid("57797fe5-ee9b-4408-98a9-20b134e7e8f0")]
@@ -35,16 +35,16 @@ class CSyncClockFilter: public ISyncClock, public CBaseFilter
{
public:
CSyncClockFilter(LPUNKNOWN pUnk, HRESULT *phr);
- virtual ~CSyncClockFilter();
+ virtual ~CSyncClockFilter();
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface( REFIID riid, void ** ppv);
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
- // ISyncClock
- STDMETHODIMP AdjustClock(DOUBLE adjustment);
- STDMETHODIMP SetBias(DOUBLE bias);
- STDMETHODIMP GetBias(DOUBLE *bias);
- STDMETHODIMP GetStartTime(REFERENCE_TIME *startTime);
+ // ISyncClock
+ STDMETHODIMP AdjustClock(DOUBLE adjustment);
+ STDMETHODIMP SetBias(DOUBLE bias);
+ STDMETHODIMP GetBias(DOUBLE *bias);
+ STDMETHODIMP GetStartTime(REFERENCE_TIME *startTime);
// CBaseFilter methods
int CSyncClockFilter::GetPinCount();
diff --git a/src/filters/misc/SyncClock/resource.h b/src/filters/misc/SyncClock/resource.h
index 840f23225..0747f6fe1 100644
--- a/src/filters/misc/SyncClock/resource.h
+++ b/src/filters/misc/SyncClock/resource.h
@@ -3,7 +3,7 @@
// Used by SyncClock.rc
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
diff --git a/src/filters/misc/SyncClock/stdafx.cpp b/src/filters/misc/SyncClock/stdafx.cpp
index 8905f2db5..0385cc615 100644
--- a/src/filters/misc/SyncClock/stdafx.cpp
+++ b/src/filters/misc/SyncClock/stdafx.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
diff --git a/src/filters/misc/SyncClock/stdafx.h b/src/filters/misc/SyncClock/stdafx.h
index c35359c38..a9f666228 100644
--- a/src/filters/misc/SyncClock/stdafx.h
+++ b/src/filters/misc/SyncClock/stdafx.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2003-2006 Gabest
* http://www.gabest.org
*
@@ -6,15 +6,15 @@
* 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.
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/