[xiph-commits] r8869 - trunk/oggdsf/src/lib/helper/libOOOggChef

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Mon Feb 7 21:02:15 PST 2005


Author: ozone
Date: 2005-02-07 21:02:13 -0800 (Mon, 07 Feb 2005)
New Revision: 8869

Modified:
   trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
   trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
Log:
oggdsf:
 * Fix libOOOggChef so it doesn't output Annodex secondary headers twice

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp	2005-02-07 22:21:53 UTC (rev 8868)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp	2005-02-08 05:02:13 UTC (rev 8869)
@@ -324,6 +324,9 @@
 							// Add the association to our stream list
 							mWantedStreamSerialNumbers.push_back(locMap);
 
+							// Add the association to the list of pending secondary headers
+							mPendingSecondaryHeaders.push_back(locMap);
+
 							if (!wantOnlyPacketBody(mWantedMIMETypes)) {
 								unsigned char *locRawPageData = inOggPage->createRawPageData();
 								mBufferWriter(locRawPageData,
@@ -350,10 +353,10 @@
 				{
 					// Only output headers for the streams that the user wants
 					// in their request
-					for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
-						if (mWantedStreamSerialNumbers[i].first == inOggPage->header()->StreamSerialNo()) {
-							if (mWantedStreamSerialNumbers[i].second >= 1) {
-								mWantedStreamSerialNumbers[i].second--;
+					for (unsigned int i = 0; i < mPendingSecondaryHeaders.size(); i++) {
+						if (mPendingSecondaryHeaders[i].first == inOggPage->header()->StreamSerialNo()) {
+							if (mPendingSecondaryHeaders[i].second >= 1) {
+								mPendingSecondaryHeaders[i].second--;
 								if (wantOnlyPacketBody(mWantedMIMETypes)) {
 									OggPacket* locPacket = inOggPage->getPacket(0);
 									mBufferWriter(locPacket->packetData(),
@@ -374,8 +377,8 @@
 					}
 
 					bool allEmpty = true;
-					for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
-						if (mWantedStreamSerialNumbers[i].second != 0) {
+					for (unsigned int i = 0; i < mPendingSecondaryHeaders.size(); i++) {
+						if (mPendingSecondaryHeaders[i].second != 0) {
 							allEmpty = false;
 						}
 					}
@@ -436,6 +439,10 @@
 						}
 					}
 
+					// Check whether we've seen all the secondary headers yet:
+					// if we have, change our state to indicate that, and start
+					// delivering the data to the user
+
 					bool allEmpty = true;
 					for (unsigned int i = 0; i < mWantedStreamSerialNumbers.size(); i++) {
 						if (mWantedStreamSerialNumbers[i].second != 0) {

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h	2005-02-07 22:21:53 UTC (rev 8868)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h	2005-02-08 05:02:13 UTC (rev 8869)
@@ -90,4 +90,6 @@
 
 	vector<tSerial_HeadCountPair> mWantedStreamSerialNumbers;
 	const vector<string>* mWantedMIMETypes;
+
+	vector<tSerial_HeadCountPair> mPendingSecondaryHeaders;
 };



More information about the commits mailing list