[xiph-commits] r10272 - in branches/oggdsf_new_demux/src/lib: codecs/vorbis/filters/dsfVorbisDecoder core/directshow/dsfOggDemux2

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Oct 23 05:33:26 PDT 2005


Author: illiminable
Date: 2005-10-23 05:33:18 -0700 (Sun, 23 Oct 2005)
New Revision: 10272

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp
   branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
Log:
* Implement IOggDecoder on the correct pin
* Clone the buffered pages, so they can be properly deleted later.

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 11:56:06 UTC (rev 10271)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 12:33:18 UTC (rev 10272)
@@ -72,6 +72,11 @@
 		*ppv = (IMediaSeeking*)this;
 		((IUnknown*)*ppv)->AddRef();
 		return NOERROR;
+	} else if (riid == IID_IOggDecoder) {
+		*ppv = (IOggDecoder*)this;
+		((IUnknown*)*ppv)->AddRef();
+		return NOERROR;
+
 	}
 
 	return AbstractTransformInputPin::NonDelegatingQueryInterface(riid, ppv); 

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp	2005-10-23 11:56:06 UTC (rev 10271)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp	2005-10-23 12:33:18 UTC (rev 10272)
@@ -50,11 +50,6 @@
 		*ppv = (IMediaSeeking*)this;
 		((IUnknown*)*ppv)->AddRef();
 		return NOERROR;
-	} else if (riid == IID_IOggDecoder) {
-		*ppv = (IOggDecoder*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-
 	}
 
 	return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 

Modified: branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2005-10-23 11:56:06 UTC (rev 10271)
+++ branches/oggdsf_new_demux/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2005-10-23 12:33:18 UTC (rev 10272)
@@ -318,19 +318,23 @@
 	vector<OggPage*> locList;
 	for (size_t i = 0; i < mBufferedPages.size(); i++) {
 		if (mBufferedPages[i]->header()->StreamSerialNo() == inSerialNo) {
-			locList.push_back(mBufferedPages[i]);
+			locList.push_back(mBufferedPages[i]->clone());
 		}
 	}
 	return locList;
 }
 void OggDemuxPacketSourceFilter::removeMatchingBufferedPages(unsigned long inSerialNo)
 {
+	vector<OggPage*> locNewList;
 	int locSize = mBufferedPages.size();
-	for (vector<OggPage*>::iterator i = mBufferedPages.end(); i != mBufferedPages.begin(); i--) {
-		if ((*i)->header()->StreamSerialNo() == inSerialNo) {
-			mBufferedPages.erase(i); //.erase(i);
+	for (int i = 0; i < locSize; i++) {
+		if (mBufferedPages[i]->header()->StreamSerialNo() != inSerialNo) {
+			locNewList.push_back(mBufferedPages[i]);
+		} else {
+			delete mBufferedPages[i];
 		}
 	}
+	mBufferedPages = locNewList;
 
 }
 



More information about the commits mailing list