[xiph-commits] r16908 - in trunk/oggdsf/src/lib: core/directshow/dsfOggDemux2 core/directshow/libDirectshowAbstracts helper/common
cristianadam at svn.xiph.org
cristianadam at svn.xiph.org
Wed Feb 17 14:48:01 PST 2010
Author: cristianadam
Date: 2010-02-17 14:48:01 -0800 (Wed, 17 Feb 2010)
New Revision: 16908
Modified:
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp
trunk/oggdsf/src/lib/helper/common/Log.h
Log:
Nicer demuxer logging. Fix for Ticket #1546 - OGV file(s) are crashing WMP (12)
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp 2010-02-17 18:52:33 UTC (rev 16907)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp 2010-02-17 22:48:01 UTC (rev 16908)
@@ -184,7 +184,6 @@
//Debugging
if (strcmp((const char*)mInterBuff, "1000") == 0) {
debugLog<<"---- Probably failure point"<<endl;
- int x= x;
}
}
void HTTPStreamingFileSource::DataProcessLoop() {
@@ -192,7 +191,6 @@
int locNumRead = 0;
char* locBuff = NULL;
DWORD locCommand = 0;
- bool locSeenAny = false;
debugLog<<"Starting dataprocessloop"<<endl;
mIsBufferFilling = false;
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp 2010-02-17 18:52:33 UTC (rev 16907)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp 2010-02-17 22:48:01 UTC (rev 16908)
@@ -727,7 +727,7 @@
*pDuration = mSeekTable->fileDuration();
- LOG(logDEBUG3) << "IMediaSeeking::GetDuration([out] " << ToString(*pDuration) << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::GetDuration(" << ReferenceTime(*pDuration) << ") -> 0x" << std::hex << S_OK;
return S_OK;
}
@@ -743,7 +743,7 @@
result = S_FALSE;
}
- LOG(logDEBUG3) << "IMediaSeeking::CheckCapabilities([out] " << *pCapabilities << ") -> 0x" << std::hex << result;
+ LOG(logDEBUG3) << "IMediaSeeking::CheckCapabilities(" << *pCapabilities << ") -> 0x" << std::hex << result;
return result;
}
@@ -757,7 +757,7 @@
result = S_OK;
}
- LOG(logDEBUG3) << "IMediaSeeking::IsFormatSupported([in] " << ToString(*pFormat) << ") -> 0x" << std::hex << result;
+ LOG(logDEBUG3) << "IMediaSeeking::IsFormatSupported(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
return result;
}
@@ -766,14 +766,14 @@
{
*pFormat = TIME_FORMAT_MEDIA_TIME;
- LOG(logDEBUG3) << "IMediaSeeking::QueryPreferredFormat([out] " << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::QueryPreferredFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK;
return S_OK;
}
STDMETHODIMP OggDemuxPacketSourceFilter::SetTimeFormat(const GUID *pFormat)
{
- LOG(logDEBUG3) << "IMediaSeeking::SetTimeFormat([in] " << ToString(pFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
+ LOG(logDEBUG3) << "IMediaSeeking::SetTimeFormat(" << ToString(pFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
return E_NOTIMPL;
}
@@ -782,7 +782,7 @@
{
*pFormat = TIME_FORMAT_MEDIA_TIME;
- LOG(logDEBUG3) << "IMediaSeeking::GetTimeFormat([out] " << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::GetTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK;
return S_OK;
}
@@ -796,7 +796,7 @@
*pStop = mSeekTable->fileDuration();
- LOG(logDEBUG3) << "IMediaSeeking::GetStopPosition([out] " << ToString(*pStop) << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::GetStopPosition(" << ReferenceTime(*pStop) << ") -> 0x" << std::hex << S_OK;
return S_OK;
}
@@ -808,9 +808,9 @@
STDMETHODIMP OggDemuxPacketSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
{
- LOG(logDEBUG3) << "IMediaSeeking::ConvertTimeFormat([out] " << ToString(pTarget)
- << ", [in] " << ToString(pTargetFormat) << ", [in] " << ToString(Source)
- << ", [in] " << ToString(pSourceFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
+ LOG(logDEBUG3) << "IMediaSeeking::ConvertTimeFormat(" << ToString(pTarget)
+ << ", " << ToString(pTargetFormat) << ", " << ToString(Source)
+ << ", " << ToString(pSourceFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
return E_NOTIMPL;
}
@@ -819,8 +819,8 @@
{
CAutoLock locLock(m_pLock);
- LOG(logDEBUG3) << "IMediaSeeking::SetPositions([in, out] " << ToString(pCurrent) << ", [in] " << dwCurrentFlags
- << ", [in, out] " << ToString(pStop) << ", [in] " << dwStopFlags << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::SetPositions(" << ReferenceTime(*pCurrent) << ", " << dwCurrentFlags
+ << ", " << ReferenceTime(*pStop) << ", " << dwStopFlags << ") -> 0x" << std::hex << S_OK;
if (mSeekTable == NULL || !mSeekTable->enabled())
{
@@ -870,7 +870,7 @@
*pEarliest = 0;
*pLatest = mSeekTable->fileDuration();
- LOG(logDEBUG3) << "IMediaSeeking::GetAvailable([out] " << ToString(*pEarliest) << ", [out] " << ToString(*pLatest)
+ LOG(logDEBUG3) << "IMediaSeeking::GetAvailable(" << ToString(*pEarliest) << ", " << ToString(*pLatest)
<< ") -> 0x" << std::hex << S_OK;
return S_OK;
@@ -889,7 +889,7 @@
result = E_INVALIDARG;
}
- LOG(logDEBUG3) << "IMediaSeeking::SetRate([in] " << std::setprecision(3) << std::showpoint
+ LOG(logDEBUG3) << "IMediaSeeking::SetRate(" << std::setprecision(3) << std::showpoint
<< dRate << ") -> 0x" << std::hex << result;
return result;
@@ -899,7 +899,7 @@
{
*dRate = 1.0;
- LOG(logDEBUG3) << "IMediaSeeking::GetRate([out] " << std::setprecision(3) << std::showpoint
+ LOG(logDEBUG3) << "IMediaSeeking::GetRate(" << std::setprecision(3) << std::showpoint
<< *dRate << ") -> 0x" << std::hex << S_OK;
return S_OK;
@@ -909,7 +909,7 @@
{
*pllPreroll = 0;
- LOG(logDEBUG3) << "IMediaSeeking::GetPreroll([out] " << ToString(*pllPreroll) << ") -> 0x" << std::hex << S_OK;
+ LOG(logDEBUG3) << "IMediaSeeking::GetPreroll(" << ToString(*pllPreroll) << ") -> 0x" << std::hex << S_OK;
return S_OK;
}
@@ -923,7 +923,7 @@
result = S_OK;
}
- LOG(logDEBUG3) << "IMediaSeeking::IsUsingTimeFormat([in] " << ToString(*pFormat) << ") -> 0x" << std::hex << result;
+ LOG(logDEBUG3) << "IMediaSeeking::IsUsingTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
return result;
}
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp 2010-02-17 18:52:33 UTC (rev 16907)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp 2010-02-17 22:48:01 UTC (rev 16908)
@@ -170,12 +170,22 @@
HRESULT AbstractTransformOutputPin::DeliverNewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
{
+ if (!mDataQueue)
+ {
+ return S_FALSE;
+ }
+
mDataQueue->NewSegment(inStartTime, inStopTime, inRate);
return S_OK;
}
HRESULT AbstractTransformOutputPin::DeliverEndOfStream(void)
{
- //Lock ?????
+ if (!mDataQueue)
+ {
+ return S_FALSE;
+ }
+
+ //Lock ?????
mDataQueue->EOS();
return S_OK;
}
@@ -183,7 +193,12 @@
HRESULT AbstractTransformOutputPin::DeliverEndFlush(void)
{
CAutoLock locLock(m_pLock);
-
+
+ if (!mDataQueue)
+ {
+ return S_FALSE;
+ }
+
mDataQueue->EndFlush();
return S_OK;
}
@@ -191,7 +206,12 @@
HRESULT AbstractTransformOutputPin::DeliverBeginFlush(void)
{
CAutoLock locLock(m_pLock);
-
+
+ if (!mDataQueue)
+ {
+ return S_FALSE;
+ }
+
mDataQueue->BeginFlush();
return S_OK;
}
Modified: trunk/oggdsf/src/lib/helper/common/Log.h
===================================================================
--- trunk/oggdsf/src/lib/helper/common/Log.h 2010-02-17 18:52:33 UTC (rev 16907)
+++ trunk/oggdsf/src/lib/helper/common/Log.h 2010-02-17 22:48:01 UTC (rev 16908)
@@ -99,6 +99,9 @@
std::wostringstream& LogT<T>::Get(LogLevel level)
{
os << L"- " << NowTime();
+ os << std::setfill(L'0') << std::hex;
+ os << L" (0x" << std::setw(2) << ::GetCurrentThreadId() << L")";
+ os << std::setfill(L' ') << std::dec;
os << L" " << ToString(level) << L": ";
os << std::wstring(level > logDEBUG ? level - logDEBUG : 0, L'\t');
More information about the commits
mailing list