Skip to content

Commit

Permalink
BaseSplitter: косметика кода.
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Jul 13, 2024
1 parent 7d333b8 commit 8d36bbc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
4 changes: 0 additions & 4 deletions src/filters/parser/BaseSplitter/AsyncReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
CAsyncFileReader::CAsyncFileReader(CString fn, HRESULT& hr, BOOL bSupportURL)
: CUnknown(L"CAsyncFileReader", nullptr, &hr)
, m_bSupportURL(bSupportURL)
, m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = Open(fn) ? S_OK : E_FAIL;
}

CAsyncFileReader::CAsyncFileReader(CHdmvClipInfo::CPlaylist& Items, HRESULT& hr)
: CUnknown(L"CAsyncFileReader", nullptr, &hr)
, m_hBreakEvent(nullptr)
, m_lOsError(0)
{
hr = OpenFiles(Items) ? S_OK : E_FAIL;
}
Expand Down
6 changes: 3 additions & 3 deletions src/filters/parser/BaseSplitter/AsyncReader.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
* (C) 2006-2023 see Authors.txt
* (C) 2006-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand Down Expand Up @@ -52,8 +52,8 @@ class CAsyncFileReader : public CUnknown, public CMultiFiles, public IAsyncReade
};

protected:
HANDLE m_hBreakEvent;
LONG m_lOsError; // CFileException::m_lOsError
HANDLE m_hBreakEvent = nullptr;
LONG m_lOsError = 0; // CFileException::m_lOsError

SourceType m_sourcetype = SourceType::LOCAL;

Expand Down
10 changes: 0 additions & 10 deletions src/filters/parser/BaseSplitter/BaseSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@

CBaseSplitterFilter::CBaseSplitterFilter(LPCWSTR pName, LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid)
: CBaseFilter(pName, pUnk, this, clsid)
, m_rtDuration(0), m_rtStart(0), m_rtStop(0), m_rtCurrent(0)
, m_dRate(1.0)
, m_nOpenProgress(100)
, m_fAbort(false)
, m_rtLastStart(INVALID_TIME)
, m_rtLastStop(INVALID_TIME)
, m_priority(THREAD_PRIORITY_NORMAL)
, m_nFlag(0)
, m_iQueueDuration(QUEUE_DURATION_DEF)
//, m_iNetworkTimeout(NETWORK_TIMEOUT_DEF)
{
if (phr) {
*phr = S_OK;
Expand Down
27 changes: 16 additions & 11 deletions src/filters/parser/BaseSplitter/BaseSplitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,35 @@ class CBaseSplitterFilter
virtual HRESULT CreateOutputs(IAsyncReader* pAsyncReader) PURE; // override this ...
virtual LPCWSTR GetPartFilename(IAsyncReader* pAsyncReader);

LONGLONG m_nOpenProgress;
bool m_fAbort;
LONGLONG m_nOpenProgress = 100;
bool m_fAbort = false;

REFERENCE_TIME m_rtDuration; // derived filter should set this at the end of CreateOutputs
REFERENCE_TIME m_rtStart, m_rtStop, m_rtCurrent, m_rtNewStart, m_rtNewStop;
double m_dRate;
REFERENCE_TIME m_rtDuration = 0; // derived filter should set this at the end of CreateOutputs
REFERENCE_TIME m_rtStart = 0;
REFERENCE_TIME m_rtStop = 0;
REFERENCE_TIME m_rtCurrent = 0;
REFERENCE_TIME m_rtNewStart = 0;
REFERENCE_TIME m_rtNewStop = 0;
double m_dRate = 1.0;

std::list<DWORD> m_bDiscontinuitySent;
std::list<CBaseSplitterOutputPin*> m_pActivePins;

CAMEvent m_eEndFlush;
bool m_fFlushing;
bool m_fFlushing = false;

void DeliverBeginFlush();
void DeliverEndFlush();
HRESULT DeliverPacket(std::unique_ptr<CPacket> p);

int m_priority;
int m_priority = THREAD_PRIORITY_NORMAL;

CFontInstaller m_fontinst;

DWORD m_nFlag;
DWORD m_nFlag = 0;

int m_iQueueDuration; // 100..15000 ms
//int m_iNetworkTimeout; // 2000..20000 ms
int m_iQueueDuration = QUEUE_DURATION_DEF; // 100..15000 ms
//int m_iNetworkTimeout = NETWORK_TIMEOUT_DEF; // 2000..20000 ms

REFERENCE_TIME m_rtOffset = INVALID_TIME;

Expand Down Expand Up @@ -165,7 +169,8 @@ class CBaseSplitterFilter
virtual HRESULT SetPositionsInternal(void* id, LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);

private:
REFERENCE_TIME m_rtLastStart, m_rtLastStop;
REFERENCE_TIME m_rtLastStart = INVALID_TIME;
REFERENCE_TIME m_rtLastStop = INVALID_TIME;
std::list<void*> m_LastSeekers;

public:
Expand Down

0 comments on commit 8d36bbc

Please sign in to comment.