[xiph-commits] r10434 - branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2

illiminable at svn.xiph.org illiminable at svn.xiph.org
Fri Nov 25 05:09:27 PST 2005


Author: illiminable
Date: 2005-11-25 05:09:24 -0800 (Fri, 25 Nov 2005)
New Revision: 10434

Modified:
   branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp
Log:
* Protect the threaded queue, when the pin is not connected, since it will be null.

Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp	2005-11-25 12:12:37 UTC (rev 10433)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp	2005-11-25 13:09:24 UTC (rev 10434)
@@ -98,6 +98,8 @@
 	if (mIsStreamReady) {
 		mAcceptingData = true;
 		return mPacketiser.acceptOggPage(inOggPage);
+	} else {
+		delete inOggPage;
 	}
 	return false;
 }
@@ -320,13 +322,17 @@
 {
 	NewSegment(tStart, tStop, dRate);
 
-	mDataQueue->NewSegment(tStart, tStop, dRate);
+	if (mDataQueue != NULL) {
+		mDataQueue->NewSegment(tStart, tStop, dRate);
+	}
 
 	return S_OK;
 }
 HRESULT OggDemuxPacketSourcePin::DeliverEndOfStream(void)
 {
-	mDataQueue->EOS();
+	if (mDataQueue != NULL) {
+		mDataQueue->EOS();
+	}
     return S_OK;
 }
 
@@ -334,7 +340,9 @@
 {
 	CAutoLock locPackLock(mPacketiserLock);
 	
-	mDataQueue->EndFlush();
+	if (mDataQueue != NULL) {
+		mDataQueue->EndFlush();
+	}
 
 	mPacketiser.reset();
     return S_OK;
@@ -342,7 +350,9 @@
 
 HRESULT OggDemuxPacketSourcePin::DeliverBeginFlush(void)
 {
-	mDataQueue->BeginFlush();
+	if (mDataQueue != NULL) {
+		mDataQueue->BeginFlush();
+	}
 	
     return S_OK;
 }



More information about the commits mailing list