[xiph-commits] r8114 - trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Tue Oct 26 23:34:43 PDT 2004


Author: illiminable
Date: 2004-10-26 23:34:42 -0700 (Tue, 26 Oct 2004)
New Revision: 8114

Modified:
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h
Log:
* Fixed seek latency in native flac.
* still has infite destructor loop.
* Doesn't properly terminate stream.

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2004-10-27 04:22:25 UTC (rev 8113)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp	2004-10-27 06:34:42 UTC (rev 8114)
@@ -63,7 +63,8 @@
 	,	mBitsPerSample(0)
 	,	mBegun(false)
 	,	mUpto(0)
-	,	mJustStopped(true)
+	,	mJustSeeked(true)
+	,	mSeekRequest(0)
 	,	mTotalNumSamples(0)
 	
 	//,	mDecoder(NULL)
@@ -224,7 +225,8 @@
 	Close();
 	debugLog<<"Stop ##################################################################"<<endl;
 	debugLog<<"Pre seek to 0"<<endl;
-	mJustStopped = true;
+	mJustSeeked = true;
+	mSeekRequest = 0;
 	mUpto = 0;
 	debugLog<<"Post seek to 0"<<endl;
 	mFLACSourcePin->DeliverBeginFlush();
@@ -243,28 +245,29 @@
 			
 			return S_OK;
 		}
-		if (mJustStopped) {
-			mJustStopped = false;
-			debugLog<<"!!!!!!!!!!!!!!!!!!!!!!! SEEK ABSOLUTE 0"<<endl;
-			bool res2 = false;
-			{
-				CAutoLock locLock(mCodecLock);
-				res2 = seek_absolute(0);
-			}
-			if (res2) {
-				debugLog<<"Seek absolute success"<<endl;
-			}
-		}
 		{
 			CAutoLock locLock(mCodecLock);
+			if (mJustSeeked) {
+				mJustSeeked = false;
+				debugLog<<"!!!!!!!!!!!!!!!!!!!!!!! SEEK ABSOLUTE 0"<<endl;
+				bool res2 = false;
+				
+				res2 = seek_absolute(mSeekRequest);
+				
+				if (res2) {
+					debugLog<<"Seek absolute success"<<endl;
+				}
+			}
+			
 			debugLog<<"Process it"<<endl;
 			res = process_single();
+			
+			if (res) {
+				debugLog<<"Process OK"<<endl;
+			} else {
+				debugLog<<"Process FAILED"<<endl;
+			}
 		}
-		if (res) {
-			debugLog<<"Process OK"<<endl;
-		} else {
-			debugLog<<"Process FAILED"<<endl;
-		}
 	}
 
 	mFLACSourcePin->DeliverEndOfStream();
@@ -451,7 +454,9 @@
 	{
 		CAutoLock locLock(mCodecLock);
 		mUpto = 0;
-		locRes = seek_absolute(locSampleToSeek);
+		//locRes = seek_absolute(locSampleToSeek);
+		mJustSeeked = true;
+		mSeekRequest = locSampleToSeek;
 	}
 	if (locRes) {
 		debugLog<<"Seek suceeded"<<endl;

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h	2004-10-27 04:22:25 UTC (rev 8113)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h	2004-10-27 06:34:42 UTC (rev 8114)
@@ -132,7 +132,8 @@
 	fstream debugLog;
 
 	bool mBegun;
-	bool mJustStopped;
+	bool mJustSeeked;
+	__int64 mSeekRequest;
 
 	unsigned long mUpto;
 



More information about the commits mailing list