diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-19 21:36:56 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-19 21:36:56 +0400 |
commit | 587d165341ab5a27594c037348a306ecd901ac4e (patch) | |
tree | 274f2c517c47b48c57491406979c97307bce17c0 | |
parent | b9664e1796e35229686d2e89cd223ef3c6a655b8 (diff) |
move PauseGraph and ResumeGraph defines to DSUtil.h so that they are not duplicated
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5201 10f7b99b-c216-0410-bff0-8a66a9350fd8
-rw-r--r-- | src/DSUtil/DSUtil.h | 19 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitter.cpp | 2 | ||||
-rw-r--r-- | src/filters/parser/MpegSplitter/MpegSplitter.h | 21 | ||||
-rw-r--r-- | src/filters/switcher/AudioSwitcher/StreamSwitcher.h | 21 |
4 files changed, 20 insertions, 43 deletions
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h index c39f7d2e2..d38caeeff 100644 --- a/src/DSUtil/DSUtil.h +++ b/src/DSUtil/DSUtil.h @@ -200,6 +200,25 @@ public: #define EndEnumSysDev }}}
+#define PauseGraph \
+ CComQIPtr<IMediaControl> _pMC(m_pGraph); \
+ OAFilterState _fs = -1; \
+ if (_pMC) _pMC->GetState(1000, &_fs); \
+ if (_fs == State_Running) \
+ _pMC->Pause(); \
+ \
+ HRESULT _hr = E_FAIL; \
+ CComQIPtr<IMediaSeeking> _pMS((IUnknown*)(INonDelegatingUnknown*)m_pGraph); \
+ REFERENCE_TIME _rtNow = 0; \
+ if (_pMS) _hr = _pMS->GetCurrentPosition(&_rtNow);
+
+#define ResumeGraph \
+ if (SUCCEEDED(_hr) && _pMS && _fs != State_Stopped) \
+ _hr = _pMS->SetPositions(&_rtNow, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); \
+ \
+ if (_fs == State_Running && _pMS) \
+ _pMC->Run();
+
#define QI(i) (riid == __uuidof(i)) ? GetInterface((i*)this, ppv) :
#define QI2(i) (riid == IID_##i) ? GetInterface((i*)this, ppv) :
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 94f3e48a0..1bd059821 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -30,7 +30,7 @@ #include "MpegSplitter.h"
#include "moreuuids.h"
#include "../../../DSUtil/AudioParser.h"
-
+#include "../../../DSUtil/DSUtil.h"
#include "../../../mpc-hc/SettingsDefines.h"
TCHAR* MPEG2_Profile[] = {
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.h b/src/filters/parser/MpegSplitter/MpegSplitter.h index 4e407f491..d7b681276 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.h +++ b/src/filters/parser/MpegSplitter/MpegSplitter.h @@ -31,27 +31,6 @@ #define MpegSplitterName L"MPC MPEG Splitter"
#define MpegSourceName L"MPC MPEG Source"
-
-#define PauseGraph \
- CComQIPtr<IMediaControl> _pMC(m_pGraph); \
- OAFilterState _fs = -1; \
- if (_pMC) _pMC->GetState(1000, &_fs); \
- if (_fs == State_Running) \
- _pMC->Pause(); \
- \
- HRESULT _hr = E_FAIL; \
- CComQIPtr<IMediaSeeking> _pMS((IUnknown*)(INonDelegatingUnknown*)m_pGraph); \
- REFERENCE_TIME _rtNow = 0; \
- if (_pMS) _hr = _pMS->GetCurrentPosition(&_rtNow);
-
-#define ResumeGraph \
- if (SUCCEEDED(_hr) && _pMS && _fs != State_Stopped) \
- _hr = _pMS->SetPositions(&_rtNow, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); \
- \
- if (_fs == State_Running && _pMS) \
- _pMC->Run();
-
-
class __declspec(uuid("DC257063-045F-4BE2-BD5B-E12279C464F0"))
CMpegSplitterFilter
: public CBaseSplitterFilter
diff --git a/src/filters/switcher/AudioSwitcher/StreamSwitcher.h b/src/filters/switcher/AudioSwitcher/StreamSwitcher.h index 3953a406e..3e64ba43c 100644 --- a/src/filters/switcher/AudioSwitcher/StreamSwitcher.h +++ b/src/filters/switcher/AudioSwitcher/StreamSwitcher.h @@ -26,27 +26,6 @@ #include <atlbase.h>
#include <atlcoll.h>
-
-#define PauseGraph \
- CComQIPtr<IMediaControl> _pMC(m_pGraph); \
- OAFilterState _fs = -1; \
- if (_pMC) _pMC->GetState(1000, &_fs); \
- if (_fs == State_Running) \
- _pMC->Pause(); \
- \
- HRESULT _hr = E_FAIL; \
- CComQIPtr<IMediaSeeking> _pMS((IUnknown*)(INonDelegatingUnknown*)m_pGraph); \
- REFERENCE_TIME _rtNow = 0; \
- if (_pMS) _hr = _pMS->GetCurrentPosition(&_rtNow);
-
-#define ResumeGraph \
- if (SUCCEEDED(_hr) && _pMS && _fs != State_Stopped) \
- _hr = _pMS->SetPositions(&_rtNow, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); \
- \
- if (_fs == State_Running && _pMS) \
- _pMC->Run();
-
-
class CStreamSwitcherFilter;
class CStreamSwitcherPassThru : public IMediaSeeking, public CMediaPosition
|