[xiph-commits] r7954 - in trunk/oggdsf: src/lib/core/directshow/dsfOggDemux src/lib/core/ogg/libOOOggSeek website

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Oct 9 22:55:33 PDT 2004


Author: illiminable
Date: 2004-10-09 22:55:33 -0700 (Sat, 09 Oct 2004)
New Revision: 7954

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
   trunk/oggdsf/website/index.html
Log:
* If Johnny needs three apples and he already has one, how many apples does Johnny need.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp	2004-10-10 05:44:38 UTC (rev 7953)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp	2004-10-10 05:55:33 UTC (rev 7954)
@@ -59,7 +59,8 @@
 	//NEW::: Since the ogg flac 1.0 mapping there's now another option... if the new first header
 	// specifies the number of headers, we can count directly, otherwise we stll use the old
 	// method for maximum compatability.
-	mNumHeadersNeeded = iBE_Math::charArrToUShort(inOggPacket->packetData() + 7);
+	mNumHeadersNeeded = iBE_Math::charArrToUShort(inOggPacket->packetData() + 7) - 1;
+	debugLog<<"Num FLAC Headers needed = "<<mNumHeadersNeeded<<endl;
 	if (mNumHeadersNeeded == 0) {
 		//Variable number
 		// Use the old method of setting this to 1, and then decrementing it when we see the last one.
@@ -134,6 +135,7 @@
 	mLastEndGranulePos = (inPos * (__int64)mFLACFormatBlock->sampleRate)/ UNITS;
 }
 bool OggFLAC_1_0_Stream::deliverCodecHeaders() {
+	debugLog<<"Delivering Codec Headers... "<<mCodecHeaders->numPackets()<<endl;
 	StampedOggPacket* locPacket = NULL;
 	for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
 		if (i==0) {

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-10-10 05:44:38 UTC (rev 7953)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-10-10 05:55:33 UTC (rev 7954)
@@ -51,7 +51,7 @@
 	//Need to do something here !
 	mSerialNo = inBOSPage->header()->StreamSerialNo();
 	string locLogName = "G:\\logs\\oggstream" + StringHelper::numToString(mSerialNo) + ".log";
-	//debugLog.open(locLogName.c_str(), ios_base::out);
+	debugLog.open(locLogName.c_str(), ios_base::out);
 	mStreamLock = new CCritSec;
 	//This may need to be moved to derived class
 	//Yep, Sure did !
@@ -65,7 +65,7 @@
 OggStream::~OggStream(void)
 {
 	//debugLog<<"Destructor..."<<endl;
-	//debugLog.close();
+	debugLog.close();
 	delete mSourcePin;
 	delete mCodecHeaders;
 	//delete mPartialPacket;
@@ -101,7 +101,7 @@
 		if (mAllowDispatch) {
 			if (mFirstRun) {
 				mFirstRun = false;
-
+				debugLog<<"Delviering codec headers..."<<endl;
 				//Deliver the header data
 				deliverCodecHeaders();
 			}		
@@ -125,8 +125,10 @@
 	//StampedOggPacket* locPacket = processPacket(inPacket);
 	if (inPacket != NULL) {
 		//We got a comlpete packet
+		debugLog<<"Adding codec header..."<<endl;
 		mCodecHeaders->addPacket(inPacket);
 		mNumHeadersNeeded--;
+		debugLog<<"Headers still needed = "<<mNumHeadersNeeded<<endl;
 	}
 	return true;
 }
@@ -166,6 +168,7 @@
 
 unsigned long OggStream::numCodecHeaders() {
 	//TODO::: Check for null.
+	debugLog<<"Num codec headers = "<<mCodecHeaders->numPackets()<<endl;
 	return mCodecHeaders->numPackets();
 }
 void OggStream::flush() {
@@ -181,6 +184,7 @@
 	//delete mPartialPacket;
 	//TODO::: Tell the packetiser to flush.
 	//mPartialPacket = NULL;
+	debugLog<<"Flush and ignore "<<inNumPacketsToIgnore<<endl;
 	mPacketiser.reset();
 	mPacketiser.setNumIgnorePackets(inNumPacketsToIgnore);
 }

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h	2004-10-10 05:44:38 UTC (rev 7953)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h	2004-10-10 05:55:33 UTC (rev 7954)
@@ -118,5 +118,5 @@
 	OggDemuxSourceFilter* mOwningFilter;
 	CCritSec* mStreamLock;
 
-	//fstream debugLog;
+	fstream debugLog;
 };

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-10-10 05:44:38 UTC (rev 7953)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-10-10 05:55:33 UTC (rev 7954)
@@ -122,14 +122,33 @@
 			mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
 			if (mNumHeaders == 0) {
 				//Variable number of headers... need to pick it up again...
-				mNumHeaders = 2;
+				mNumHeaders = 1;
                 isOggFLAC_1_0 = true;
-				
-			} 
-			
+			} else {
+				mFoundStreamInfo = true;
+			}
 			mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 27) >> 12;
-			mFoundStreamInfo = true;
+		} else if (isOggFLAC_1_0 && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) ) {
+			//Loop any other packets
+
+			const int FLAC_LAST_HEADERS_FLAG = 128;
+			const int FLAC_HEADER_MASK = 127;
+			const int FLAC_STREAM_INFO_ID = 0;
 			
+			//Note ::: Secondary condition in for statement.
+            for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
+				mNumHeaders++;
+
+				//Don't need this, we already got this data... we're just counting headers.
+				//if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
+    //                //Catch the stream info packet.
+    //                mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 14) >> 12;
+				//}
+				if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_LAST_HEADERS_FLAG)) {
+					mFoundStreamInfo = true;
+				}
+			}
+			
 		
 
 		} else {

Modified: trunk/oggdsf/website/index.html
===================================================================
--- trunk/oggdsf/website/index.html	2004-10-10 05:44:38 UTC (rev 7953)
+++ trunk/oggdsf/website/index.html	2004-10-10 05:55:33 UTC (rev 7954)
@@ -274,7 +274,7 @@
 <li>If you install <a href="http://sourceforge.net/projects/ffdshow">ffdshow</a>, you will be able to play ogm style *video only* files (ie OGM\DivX in one stream and non-OGM vorbis in the other).</li>
 <li>Also, if you download, install and register <a href="http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84799">Gabests .cda directshow source</a> you can rip CD's using graphedit</li>
 <li>Looking for <a href="http://www.illiminable.com/ogg/history.html">old versions</a> ?</li>
-<li>Want the <a href="http://www.illiminable.com/ogg/oggcodecs_src_0.64.7878.zip">zipped source code</a> (8.5 MB zipped, 30MB unzipped) ?</li>
+<li>Want the <a href="http://www.illiminable.com/ogg/oggcodecs_src_0.65.7923.zip">zipped source code</a> (8.5 MB zipped, 30MB unzipped) ?</li>
 <li>Want to <a href="http://svn.xiph.org/trunk/oggdsf/">browse the source on the web</a> </li>
 <li><a href="http://www.illiminable.com/ogg/sse_builds.html">Experimental SSE/SSE2 builds can be found here</a></li>
 <br>



More information about the commits mailing list