[xiph-commits] r8294 - in trunk/oggdsf/src/lib/core: directshow/dsfOggDemux ogg/libOOOggSeek

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Nov 27 00:13:54 PST 2004


Author: illiminable
Date: 2004-11-27 00:13:54 -0800 (Sat, 27 Nov 2004)
New Revision: 8294

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
Log:
* Smoothed out a little hack in the seek table.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-11-27 07:07:43 UTC (rev 8293)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-11-27 08:13:54 UTC (rev 8294)
@@ -311,11 +311,13 @@
 		//debugLog<<"       : Begin flush Delviered."<<endl;
 
 		//Find the byte position for this time.
-		unsigned long locStartPos = mSeekTable->getStartPos(*pCurrent);
+		OggSeekTable::tSeekPair locStartPos = mSeekTable->getStartPos(*pCurrent);
 		bool locSendExcess = false;
 
 		//FIX::: This code needs to be removed, and handle start seek case.
-		if (locStartPos == mStreamMapper->startOfData()) {
+		//.second is the file position.
+		//.first is the time in DS units
+		if (locStartPos.second == mStreamMapper->startOfData()) {
 			locSendExcess = true;
 		}
 		
@@ -324,7 +326,8 @@
 		// we have to use granule pos timestamps in order for downstream codecs to work.
 		// Because of this we can't factor time bases after seeking into the sample times.
 		*pCurrent	= mSeekTimeBase 
-					= mSeekTable->getRealStartPos();
+					//= mSeekTable->getRealStartPos();
+					= locStartPos.first;		//Time from seek pair.
 
 		//debugLog<<"Corrected pCurrent : "<<mSeekTimeBase<<endl;
 		for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
@@ -339,8 +342,8 @@
 			DeliverNewSegment(*pCurrent, mSeekTable->fileDuration(), 1.0);
 		}
 
-	
-		mDataSource->seek(locStartPos);
+		//.second is the file position.
+		mDataSource->seek(locStartPos.second);
 		//
 
 	

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-11-27 07:07:43 UTC (rev 8293)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-11-27 08:13:54 UTC (rev 8294)
@@ -61,10 +61,10 @@
 	return mRealStartPos;
 
 }
-unsigned long OggSeekTable::getStartPos(__int64 inTime) {
-	 pair<__int64, unsigned long> locValue = *(mSeekMap.lower_bound(inTime));
-	 mRealStartPos = locValue.first;
+OggSeekTable::tSeekPair OggSeekTable::getStartPos(__int64 inTime) {
+	 return *(mSeekMap.lower_bound(inTime));
+	 //mRealStartPos = locValue.first;
 	 //stDebug<<"Get Point : Time Req = "<<inTime<<"   --   Time Given = "<<mRealStartPos<<"   --   Byte Pos : "<<locValue.second<<endl;
-	 return locValue.second;
+	 //return locValue.second;
 	
 }

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-11-27 07:07:43 UTC (rev 8293)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-11-27 08:13:54 UTC (rev 8294)
@@ -41,13 +41,15 @@
 	OggSeekTable(void);
 	virtual ~OggSeekTable(void);
 
+	typedef pair<__int64, unsigned long> tSeekPair;
+
 	bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
-	unsigned long getStartPos(__int64 inTime);
+	tSeekPair getStartPos(__int64 inTime);
 	__int64 getRealStartPos();
 
 	bool enabled();
 
-	typedef pair<__int64, unsigned long> tSeekPair;
+
 protected:
 	typedef map<__int64, unsigned long> tSeekMap;
 	tSeekMap mSeekMap;



More information about the commits mailing list