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

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Fri Nov 26 23:07:44 PST 2004


Author: illiminable
Date: 2004-11-26 23:07:43 -0800 (Fri, 26 Nov 2004)
New Revision: 8293

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
Log:
* Tried to improve the OGM seeking... still doesn't work properly yet.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp	2004-11-27 03:56:29 UTC (rev 8292)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp	2004-11-27 07:07:43 UTC (rev 8293)
@@ -38,7 +38,7 @@
 	:	OggStream(inBOSPage, inOwningFilter, inAllowSeek)
 	,	mFFDShowVideoFormatBlock(NULL)
 	,	mLastTimeStamp(0)
-	//,	mLastGranulePos(0)
+	,	mLastKnownTimeBase(0)
 	,	mGranuleOffset(0)
 {
 	InitCodec(inBOSPage->getStampedPacket(0));
@@ -199,13 +199,25 @@
 	unsigned char* locBuff = new unsigned char[inPacket->packetSize() - 1];
 	memcpy((void*)locBuff, (const void*) (inPacket->packetData() + 1), inPacket->packetSize() - 1);
 	
-	
 
+	//This is to help ffdshow handle timestamps the way it likes them.
+	//Everytime, the start time changes, we record it and reset the granule counter (frame count)
+	//This lets ogm stuff be seekable cleanly.
+	if ((mLastKnownTimeBase != inPacket->startTime()) && (inPacket->startTime() != -1)) {
+		mLastKnownTimeBase = inPacket->startTime();
+		mLastTimeStamp = mLastKnownTimeBase * mFFDShowVideoFormatBlock->AvgTimePerFrame;
+		debugLog<<"Last Time base set  to  "<<mLastKnownTimeBase<<endl;
+		debugLog<<"Last time stamp set to "<<mLastTimeStamp<<endl;
+
+		//Granule Offset may not be needed any more.
+		mGranuleOffset = 0;
+	}
+
 	debugLog<<"Packet stamps = "<<inPacket->startTime() << " - "<<inPacket->endTime()<<endl;
 
 	debugLog<<"m_tStart = "<<mSourcePin->CurrentStartTime()<<endl;
 	LONGLONG locStart = mLastTimeStamp - mSourcePin->CurrentStartTime();
-	LONGLONG locEnd = (mGranuleOffset) * mFFDShowVideoFormatBlock->AvgTimePerFrame - mSourcePin->CurrentStartTime();
+	LONGLONG locEnd = locStart + mFFDShowVideoFormatBlock->AvgTimePerFrame;
 	mGranuleOffset++;
 
 	debugLog<<"Time Stamps = "<<locStart<<" - "<<locEnd<<endl;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h	2004-11-27 03:56:29 UTC (rev 8292)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h	2004-11-27 07:07:43 UTC (rev 8293)
@@ -65,7 +65,7 @@
 	StampedOggPacket* mHeaderPack;
 
 	LONGLONG mLastTimeStamp;
-	//LONGLONG mLastGranulePos;
+	LONGLONG mLastKnownTimeBase;
 	LONGLONG mGranuleOffset;
 
 	fstream debugLog;

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-11-27 03:56:29 UTC (rev 8292)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp	2004-11-27 07:07:43 UTC (rev 8293)
@@ -220,6 +220,10 @@
 bool OggStream::acceptOggPage(OggPage* inOggPage) {		//Gives away page.
 	
 	//debugLog<<"Accepting ogg page..."<<endl;
+
+
+	//TODO::: Is this even necessary any more ?????
+
 	//Chaining hack for icecast.
 	if ( (!mAllowSeek) && (inOggPage->header()->isBOS() )) {
 		//debugLog<<"ice case hack"<<endl;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-11-27 03:56:29 UTC (rev 8292)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-11-27 07:07:43 UTC (rev 8293)
@@ -47,6 +47,7 @@
 
 	bool enabled();
 
+	typedef pair<__int64, unsigned long> tSeekPair;
 protected:
 	typedef map<__int64, unsigned long> tSeekMap;
 	tSeekMap mSeekMap;



More information about the commits mailing list