[xiph-commits] r10357 - branches/oggdsf_new_demux/src/lib/codecs/flac/filters/dsfFLACDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Tue Nov 8 03:17:12 PST 2005


Author: illiminable
Date: 2005-11-08 03:17:08 -0800 (Tue, 08 Nov 2005)
New Revision: 10357

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
Log:
* Support for oggflac 1.0 back in flac filter.

Modified: branches/oggdsf_new_demux/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp	2005-11-08 07:29:49 UTC (rev 10356)
+++ branches/oggdsf_new_demux/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp	2005-11-08 11:17:08 UTC (rev 10357)
@@ -507,6 +507,42 @@
 				default:
 					return IOggDecoder::AHR_UNEXPECTED;
 			}
+
+		case FT_OGG_FLAC_1:
+			switch(mSetupState) {
+				case VSS_SEEN_NOTHING:
+					if (strncmp((char*)inCodecHeaderPacket->packetData(),  "\177FLAC", 5) == 0) {
+						mSetupState = VSS_SEEN_BOS;
+						delete mMetadataPacket;
+						unsigned char* locBuff = new unsigned char[inCodecHeaderPacket->packetSize() - 9];
+						memcpy((void*)locBuff, (const void*)(inCodecHeaderPacket->packetData() + 9), inCodecHeaderPacket->packetSize() - 9);
+						mMetadataPacket = new OggPacket(locBuff, inCodecHeaderPacket->packetSize() - 9,  false, false);
+						return IOggDecoder::AHR_MORE_HEADERS_TO_COME;
+					}
+
+					
+					mSetupState = VSS_ERROR;
+					return IOggDecoder::AHR_INVALID_HEADER;
+				case VSS_SEEN_BOS:
+					mMetadataPacket->merge(inCodecHeaderPacket);
+					if ((inCodecHeaderPacket->packetData()[0] & MORE_HEADERS_MASK) != 0) {
+						//Last packet
+						mSetupState = VSS_ALL_HEADERS_SEEN; 
+						((FLACDecodeFilter*)mParentFilter)->setFLACFormatBlock(mMetadataPacket->packetData());
+						mFLACDecoder.acceptMetadata(mMetadataPacket);
+						mMetadataPacket = NULL;
+				
+						//TODO::: Give it to the codec
+
+						return IOggDecoder::AHR_ALL_HEADERS_RECEIVED;
+					}
+
+					return IOggDecoder::AHR_MORE_HEADERS_TO_COME;
+				default:
+					return IOggDecoder::AHR_UNEXPECTED;
+
+
+			};
 		default:
 			return IOggDecoder::AHR_INVALID_HEADER;
 



More information about the commits mailing list