[xiph-commits] r7950 - in trunk/oggdsf/src/lib: codecs/flac/filters/dsfFLACEncoder codecs/flac/libs/libFLACHelper core/directshow/dsfOggDemux core/ogg/libOOOggSeek

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Oct 9 10:01:32 PDT 2004


Author: illiminable
Date: 2004-10-09 10:01:31 -0700 (Sat, 09 Oct 2004)
New Revision: 7950

Modified:
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp
   trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
Log:
* New FLAC encoder and decoder work.
* Decoder/Demux can handle both new flac and flac classic.
* Encoder only outputs new flac.

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp	2004-10-09 15:36:55 UTC (rev 7949)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp	2004-10-09 17:01:31 UTC (rev 7950)
@@ -229,13 +229,13 @@
 					
 					HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample);						//->DownstreamFilter()->Receive(locSample);
 					if (locHR != S_OK) {
-						//locThis->debugLog<<"Sample rejected"<<endl;
+						debugLog<<"Sample rejected"<<endl;
 					} else {
-						//locThis->debugLog<<"Sample Delivered"<<endl;
+						debugLog<<"Sample Delivered"<<endl;
 					}
 				}
 
-				return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
+				
 
 
 			}

Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp	2004-10-09 15:36:55 UTC (rev 7949)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp	2004-10-09 17:01:31 UTC (rev 7950)
@@ -31,10 +31,10 @@
 			//Last header
 			mSeenAllHeaders = true;
 			if (createNewHeaderList()) {
-				debugLog<<"Create new headers FAILED"<<endl;
+				debugLog<<"Create new headers OK"<<endl;
 				return LAST_HEADER_ACCEPTED;
 			} else {
-				debugLog<<"Create new headers OK"<<endl;
+				debugLog<<"Create new headers FAILED"<<endl;
 				return HEADER_ERROR;
 			}
 		} else {

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-09 15:36:55 UTC (rev 7949)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp	2004-10-09 17:01:31 UTC (rev 7950)
@@ -83,11 +83,11 @@
 	mFLACFormatBlock = new sFLACFormatBlock;
 	//Fix the format block data... use header version and other version.
 	//mFLACFormatBlock->FLACVersion = FLACMath::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 28);
-	mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(1)->packetData()[25]) & FLAC_CHANNEL_MASK) >> 1) + 1;
-	mFLACFormatBlock->sampleRate = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 23)) >> 12;
+	mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(0)->packetData()[29]) & FLAC_CHANNEL_MASK) >> 1) + 1;
+	mFLACFormatBlock->sampleRate = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 27)) >> 12;
 	
-	mFLACFormatBlock->numBitsPerSample =	(((mCodecHeaders->getPacket(1)->packetData()[25] & FLAC_BPS_START_MASK) << 4)	|
-											((mCodecHeaders->getPacket(1)->packetData()[26] & FLAC_BPS_END_MASK) >> 4)) + 1;	
+	mFLACFormatBlock->numBitsPerSample =	(((mCodecHeaders->getPacket(0)->packetData()[29] & FLAC_BPS_START_MASK) << 4)	|
+											((mCodecHeaders->getPacket(0)->packetData()[30] & FLAC_BPS_END_MASK) >> 4)) + 1;	
 	return true;
 }
 BYTE* OggFLAC_1_0_Stream::getFormatBlock() {

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-10-09 15:36:55 UTC (rev 7949)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-10-09 17:01:31 UTC (rev 7950)
@@ -42,6 +42,7 @@
 	,	mSerialNoToTrack(LINT_MAX)
 	,	isTheora(false)
 	,	isFLAC(false)
+	,	isOggFLAC_1_0(false)
 	,	mFoundStreamInfo(false)
 	,	mGranulePosShift(0)
 	,	mLastIsSeekable(false)
@@ -114,6 +115,23 @@
 					mFoundStreamInfo = true;
 				}
 			}
+		} else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(),  "\177FLAC", 5) == 0)) {
+			//mPacketCount--;
+			//POTENTIAL BUG::: Only looks at low order byte
+			mNumHeaders = inOggPage->getPacket(0)->packetData()[8];
+			mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+			if (mNumHeaders == 0) {
+				//Variable number of headers... need to pick it up again...
+				mNumHeaders = 2;
+                isOggFLAC_1_0 = true;
+				
+			} 
+			
+			mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 27) >> 12;
+			mFoundStreamInfo = true;
+			
+		
+
 		} else {
 			mFoundStreamInfo = true;		//Why do this ?
 			mEnabled = false;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h	2004-10-09 15:36:55 UTC (rev 7949)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h	2004-10-09 17:01:31 UTC (rev 7950)
@@ -69,6 +69,7 @@
 	bool mLastIsSeekable;
 	bool isTheora;
 	bool isFLAC;
+	bool isOggFLAC_1_0;
 	bool mFoundStreamInfo;
 	__int64 mLastSeekTime;
 	__int64 mFileDuration;



More information about the commits mailing list