[xiph-commits] r8436 - trunk/oggdsf/src/lib/core/ogg/libOOOggSeek

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Thu Dec 16 03:48:28 PST 2004


Author: illiminable
Date: 2004-12-16 03:48:28 -0800 (Thu, 16 Dec 2004)
New Revision: 8436

Modified:
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
Log:
* Serialisable seektable

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-12-16 11:30:37 UTC (rev 8435)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-12-16 11:48:28 UTC (rev 8436)
@@ -219,7 +219,29 @@
 
 	return true;
 }
+unsigned long AutoOggSeekTable::serialisedSize() {
+	return mSeekMap.size() * 12;
+	
+}
+bool AutoOggSeekTable::serialiseInto(unsigned char* inBuff, unsigned long inBuffSize) {
+	if (inBuffSize >= serialisedSize()) {
+		unsigned long locUpto = 0;
+		for (tSeekMap::const_iterator i = mSeekMap.begin(); i != mSeekMap.end(); i++) {
 
+			//Time is .first
+			iLE_Math::Int64ToCharArr((*i).first, inBuff + locUpto);
+			locUpto += 8;
+
+			//Byte offset is .second
+			iLE_Math::ULongToCharArr((*i).second, inBuff + locUpto);
+			locUpto += 4;
+		}
+		return true;
+	} else {
+		return false;
+	}
+}
+
 __int64 AutoOggSeekTable::fileDuration() {
 	return mFileDuration;
 }

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-12-16 11:30:37 UTC (rev 8435)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-12-16 11:48:28 UTC (rev 8436)
@@ -52,6 +52,7 @@
 bool OggSeekTable::addSeekPoint(__int64 inTime, unsigned long mStartPos) {
 	//stDebug<< "Add Point :  Time = "<<inTime<<"   --   Byte Pos : "<<mStartPos<<endl;
 	mSeekMap.insert(tSeekMap::value_type(inTime, mStartPos));
+
 	return true;
 
 }



More information about the commits mailing list