[xiph-commits] r7946 -
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Sat Oct 9 03:49:40 PDT 2004
Author: illiminable
Date: 2004-10-09 03:49:39 -0700 (Sat, 09 Oct 2004)
New Revision: 7946
Modified:
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
Log:
* Change the new flac stream to reconstruct the naked flac data blocks from the new style ones.
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 10:32:24 UTC (rev 7945)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp 2004-10-09 10:49:39 UTC (rev 7946)
@@ -137,7 +137,19 @@
StampedOggPacket* locPacket = NULL;
for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
if (i==0) {
- locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
+ //Need to reconstruct what the meta-data blocks look like in naked flac,
+ // so strip away most of the new header.
+ //
+ //New part of ogg header is 9 bytes
+ //old flac ident is 4 bytes
+ //StreamInfoHeader is 38 bytes
+ //
+ //So we discard the first 9 bytes, and keep the next 42 bytes.
+ unsigned char* locPackBuf = new unsigned char[42];
+
+ //locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
+ memcpy((void*)locPackBuf, (const void*)mCodecHeaders->getPacket(0)->packetData() + 9, 42);
+ locPacket = new StampedOggPacket(locPackBuf, 42, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
} else {
locPacket->merge(mCodecHeaders->getPacket(i));
}
More information about the commits
mailing list