[xiph-commits] r8018 - in trunk/oggdsf/src/lib/core/directshow: dsfOggDemux dsfSeeking

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sat Oct 16 02:02:26 PDT 2004


Author: illiminable
Date: 2004-10-16 02:02:26 -0700 (Sat, 16 Oct 2004)
New Revision: 8018

Modified:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
Log:
* Added code to the installation to delete a leftover key from tobias filters causing an explorer bug when deleting files.

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp	2004-10-16 09:02:26 UTC (rev 8018)
@@ -218,7 +218,7 @@
 
 STDMETHODIMP OggDemuxSourceFilter::GetCapabilities(DWORD* inCapabilities) {
 	if (mSeekTable->enabled())  {
-		//debugLog<<"GetCaps "<<mSeekingCap<<endl;
+		debugLog<<"GetCaps "<<mSeekingCap<<endl;
 		*inCapabilities = mSeekingCap;
 		return S_OK;
 	} else {
@@ -229,7 +229,7 @@
 }
 STDMETHODIMP OggDemuxSourceFilter::GetDuration(LONGLONG* outDuration) {
 	if (mSeekTable->enabled())  {
-		//debugLog<<"GetDuration = " << mSeekTable->fileDuration()<<" ds units"<<endl;
+		debugLog<<"GetDuration = " << mSeekTable->fileDuration()<<" ds units"<<endl;
 		*outDuration = mSeekTable->fileDuration();
 		return S_OK;
 	} else {
@@ -249,22 +249,22 @@
 STDMETHODIMP OggDemuxSourceFilter::IsFormatSupported(const GUID *pFormat){
 	ASSERT(pFormat != NULL);
 	if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
-		//debugLog<<"IsFormatSupported	: TRUE"<<endl;
+		debugLog<<"IsFormatSupported	: TRUE"<<endl;
 		return S_OK;
 	} else {
-		//debugLog<<"IsFormatSupported	: FALSE !!!"<<endl;
+		debugLog<<"IsFormatSupported	: FALSE !!!"<<endl;
 		return S_FALSE;
 	}
 	
 	
 }
 STDMETHODIMP OggDemuxSourceFilter::QueryPreferredFormat(GUID *pFormat){
-	//debugLog<<"QueryPrefferedTimeFormat	: MEDIA TIME"<<endl;
+	debugLog<<"QueryPrefferedTimeFormat	: MEDIA TIME"<<endl;
 	*pFormat = TIME_FORMAT_MEDIA_TIME;
 	return S_OK;
 }
 STDMETHODIMP OggDemuxSourceFilter::SetTimeFormat(const GUID *pFormat){
-	//debugLog<<"SetTimeForamt : NOT IMPL"<<endl;
+	debugLog<<"SetTimeForamt : NOT IMPL"<<endl;
 	return E_NOTIMPL;
 }
 STDMETHODIMP OggDemuxSourceFilter::GetTimeFormat( GUID *pFormat){
@@ -274,30 +274,32 @@
 STDMETHODIMP OggDemuxSourceFilter::GetStopPosition(LONGLONG *pStop){
 	if (mSeekTable->enabled())  {
 
-		//debugLog<<"GetStopPos = " << mSeekTable->fileDuration()<<" ds units"<<endl;
+		debugLog<<"GetStopPos = " << mSeekTable->fileDuration()<<" ds units"<<endl;
 		*pStop = mSeekTable->fileDuration();
 		return S_OK;
 	} else {
+		debugLog<<"GetStopPos NOT IMPL"<<endl;
 		return E_NOTIMPL;
 	}
 }
 STDMETHODIMP OggDemuxSourceFilter::GetCurrentPosition(LONGLONG *pCurrent){
+	debugLog<<"GetCurrentPos = NOT_IMPL"<<endl;
 	return E_NOTIMPL;
 	//debugLog <<"GetCurrPos = HARD CODED = 6 secs"<< endl;
 	 *pCurrent = 6 * UNITS;
 	return S_OK;
 }
 STDMETHODIMP OggDemuxSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat){
-	//debugLog<<"ConvertTimeForamt : NOT IMPL"<<endl;
+	debugLog<<"ConvertTimeForamt : NOT IMPL"<<endl;
 	return E_NOTIMPL;
 }
 STDMETHODIMP OggDemuxSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags){
 
 
 	CAutoLock locLock(m_pLock);
-	//debugLog<<"Set Positions"<<endl;
+	debugLog<<"Set Positions"<<endl;
 	if (mSeekTable->enabled())  {
-		//debugLog<<"SetPos : Current = "<<*pCurrent<<" Flags = "<<dwCurrentFlags<<" Stop = "<<*pStop<<" dwStopFlags = "<<dwStopFlags<<endl;
+		debugLog<<"SetPos : Current = "<<*pCurrent<<" Flags = "<<dwCurrentFlags<<" Stop = "<<*pStop<<" dwStopFlags = "<<dwStopFlags<<endl;
 		//debugLog<<"       : Delivering begin flush..."<<endl;
 
 	
@@ -335,7 +337,7 @@
 			//debugLog<<"       : Delivering End Flush..."<<endl;
 			DeliverEndFlush();
 			//debugLog<<"       : End flush Delviered."<<endl;
-			DeliverNewSegment(*pCurrent, *pCurrent + mSeekTable->fileDuration(), 1.0);
+			DeliverNewSegment(*pCurrent, mSeekTable->fileDuration(), 1.0);
 		}
 
 	
@@ -378,17 +380,25 @@
 	return S_OK;
 }
 STDMETHODIMP OggDemuxSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop){
+	debugLog<<"Getpos : Not IMPL"<<endl;
 	//debugLog<<"GetPos : Current = HARDCODED 2 secs , Stop = "<<mSeekTable->fileDuration()/UNITS <<" secs."<<endl;
+	return E_NOTIMPL;
 	*pCurrent = 2 * UNITS;
 	*pStop = mSeekTable->fileDuration();
 	return S_OK;
 }
 STDMETHODIMP OggDemuxSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest){
 	//debugLog<<"****GetAvailable : NOT IMPL"<<endl;
-	return E_NOTIMPL;
+	if (mSeekTable->enabled())  {
+		debugLog<<"Get Avail ok"<<endl;
+		*pEarliest = 0;
+		*pLatest = mSeekTable->fileDuration();
+	} else {
+		return E_NOTIMPL;
+	}
 }
 STDMETHODIMP OggDemuxSourceFilter::SetRate(double dRate){
-	//debugLog<<"Set RATE : NOT IMPL"<<endl;
+	debugLog<<"Set RATE : NOT IMPL"<<endl;
 	return E_NOTIMPL;
 	//debugLog<<"SetRate : "<<dRate<<endl;
 	return S_OK;;
@@ -396,7 +406,7 @@
 STDMETHODIMP OggDemuxSourceFilter::GetRate(double *dRate){
 	//debugLog<<"Get RATE : Not IMPL"<<endl;
 	//return E_NOTIMPL;
-	//debugLog <<"GetRate : Hard coded to 1.0"<<endl;
+	debugLog <<"GetRate : Hard coded to 1.0"<<endl;
 	*dRate = 1.0;
 	return S_OK;;
 }
@@ -404,15 +414,15 @@
 	//debugLog<<"Get Preroll : NOT IMPL"<<endl;
 	//return E_NOTIMPL;
 	*pllPreroll = 0;
-	//debugLog<<"GetPreroll : HARD CODED TO 0"<<endl;
+	debugLog<<"GetPreroll : HARD CODED TO 0"<<endl;
 	return S_OK;
 }
 STDMETHODIMP OggDemuxSourceFilter::IsUsingTimeFormat(const GUID *pFormat){
 	if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
-		//debugLog<<"IsUsingTimeFormat : MEDIA TIME TRUE"<<endl;
+		debugLog<<"IsUsingTimeFormat : MEDIA TIME TRUE"<<endl;
 		return S_OK;
 	} else {
-		//debugLog<<"IsUsingTimeFormat : MEDIA TIME FALSE !!!!"<<endl;
+		debugLog<<"IsUsingTimeFormat : MEDIA TIME FALSE !!!!"<<endl;
 		return S_FALSE;
 	}
 	

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp	2004-10-16 09:02:26 UTC (rev 8018)
@@ -75,6 +75,29 @@
 
 }
 
+bool RegWrap::deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete) {
+	HKEY locKey;
+	LONG retVal;
+
+	retVal = RegOpenKeyEx(	inHive,
+							inKeyName.c_str(),
+							NULL,
+							KEY_ALL_ACCESS,
+							&locKey);
+
+	if (retVal != ERROR_SUCCESS) {
+		//debugLog<<"Key not found"<<endl;
+		return false;
+	}
+
+	retVal = SHDeleteKeyA(locKey, inSubKeyToDelete.c_str());
+	RegCloseKey(locKey);
+	return true;
+
+}
+
+
+
 bool RegWrap::removeKeyVal(HKEY inHive, string inKeyName, string inValueName) {
 	//LONG RegDeleteValue(
 	//	HKEY hKey,
@@ -96,6 +119,7 @@
 	}
 
 	retVal = RegDeleteValue(locKey, inValueName.c_str());
+	RegCloseKey(locKey);
 	if (retVal != ERROR_SUCCESS) {
 		return false;
 	} else {
@@ -214,16 +238,18 @@
 
 }
 bool RegWrap::addMediaPlayerDesc(string inDesc, string inExts) {
-	string locDescNum = "";
-	string locFull = inDesc+" ("+inExts+")";
-	locDescNum = RegWrap::findNextEmptyMediaPlayerDesc();
-	if (locDescNum == "") {
-		return false;
+	if (!RegWrap::valueExists(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum")) {
+		string locDescNum = "";
+		string locFull = inDesc+" ("+inExts+")";
+		locDescNum = RegWrap::findNextEmptyMediaPlayerDesc();
+		if (locDescNum == "") {
+			return false;
+		}
+		RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum", locDescNum.c_str());
+		RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locDescNum, locFull.c_str());
+		RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locDescNum, inDesc.c_str());
+		RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locDescNum, inExts.c_str());
+		return true;
 	}
-	RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum", locDescNum.c_str());
-	RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locDescNum, locFull.c_str());
-	RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locDescNum, inDesc.c_str());
-	RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locDescNum, inExts.c_str());
-	return true;
 
 }
\ No newline at end of file

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h	2004-10-16 09:02:26 UTC (rev 8018)
@@ -1,6 +1,6 @@
 #pragma once
+#include <shlwapi.h>
 
-
 //This class really shouldn't be part of this project, but i got lazy !
 //This is a pretty inefficient way to do it but its easy.
 class OGG_DEMUX_API RegWrap
@@ -15,4 +15,5 @@
 	static bool		addMediaPlayerDesc(string inDesc, string inExts);
 	static bool		removeKeyVal(HKEY inHive, string inKeyName, string inValueName);
 	static bool		removeMediaDesc();
+	static bool		deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete);
 };

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/dsfOggDemux.vcproj	2004-10-16 09:02:26 UTC (rev 8018)
@@ -36,7 +36,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Strmbasd.lib Msvcrtd.lib Winmm.lib Strmiids.lib  Quartz.lib wsock32.lib"
+				AdditionalDependencies="Strmbasd.lib Msvcrtd.lib Winmm.lib Strmiids.lib  Quartz.lib wsock32.lib shlwapi.lib"
 				ShowProgress="2"
 				OutputFile="$(OutDir)/dsfOggDemux.dll"
 				LinkIncremental="2"
@@ -102,7 +102,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib"
+				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib shlwapi.lib"
 				OutputFile="$(OutDir)/dsfOggDemux.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="C:\DXSDK\Lib;&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release&quot;"
@@ -169,7 +169,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib"
+				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib shlwapi.lib"
 				OutputFile="$(OutDir)/dsfOggDemux.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="C:\DXSDK\Lib;&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release&quot;"
@@ -236,7 +236,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib"
+				AdditionalDependencies="Strmbase.lib Winmm.lib  Strmiids.lib  Quartz.lib wsock32.lib shlwapi.lib"
 				OutputFile="$(OutDir)/dsfOggDemux.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="C:\DXSDK\Lib;&quot;C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Release&quot;"

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp	2004-10-16 09:02:26 UTC (rev 8018)
@@ -76,6 +76,7 @@
 
 	//Only call once... if you need multiple you have to fix the hack job in RegWrap !
 	RegWrap::addMediaPlayerDesc("Ogg File",  "*.ogg;*.ogv;*.oga;*.spx");
+	RegWrap::deleteKeyRecurse(HKEY_CLASSES_ROOT, ".OGG", "ShellEx");
 
 
 

Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp	2004-10-16 06:09:36 UTC (rev 8017)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp	2004-10-16 09:02:26 UTC (rev 8018)
@@ -226,7 +226,7 @@
 		HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
 		if (locHR == S_OK) {
 			//mSeekTimeBase = *inoutCurrent;
-			//seekDebug<<"Set Pos : Actual Time   : "<<mSeekTimeBase<<endl;
+			seekDebug<<"Set Pos : Actual Time   : "<<*inoutCurrent<<endl;
 			
 		}
 		return locHR;



More information about the commits mailing list