[xiph-commits] r17188 - in trunk/oggdsf: . build/NSIS/Release sln/oggdsf_vs2005 sln/oggdsf_vs2008 src/lib/codecs/cmml/dsfCMMLRawSource src/lib/codecs/cmml/libWinCMMLParse src/lib/codecs/flac/filters/dsfNativeFLACSource src/lib/codecs/theora/filters/dsfTheoraDecoder src/lib/codecs/vorbis/filters/dsfVorbisDecoder src/lib/core/directshow/dsfOggDemux2 src/lib/core/ogg/libOOOgg src/lib/core/ogg/libOOOggSeek src/lib/plugin/AxPlayer

cristianadam at svn.xiph.org cristianadam at svn.xiph.org
Mon May 3 15:38:42 PDT 2010


Author: cristianadam
Date: 2010-05-03 15:38:42 -0700 (Mon, 03 May 2010)
New Revision: 17188

Added:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.h
Removed:
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ICustomSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/IFilterDataSource.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ReadMe.txt
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.cpp
Modified:
   trunk/oggdsf/ChangeLog.txt
   trunk/oggdsf/build/NSIS/Release/build.cmd
   trunk/oggdsf/build/NSIS/Release/oggcodecs_release.nsi
   trunk/oggdsf/sln/oggdsf_vs2005/oggdsf.sln
   trunk/oggdsf/sln/oggdsf_vs2008/oggdsf.sln
   trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
   trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h
   trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
   trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h
   trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ds_guids.h
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2-2005.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/stdafx.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.h
   trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp
   trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h
Log:
Ogg Demux filter has been changed from a source + parser filter to just parser filter. This step allows usage of DirectShow's "File Source (Async.)" filter which give support of files bigger than 2GB, or "File Source (URL)" which gives better networking support.

Modified: trunk/oggdsf/ChangeLog.txt
===================================================================
--- trunk/oggdsf/ChangeLog.txt	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/ChangeLog.txt	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,8 +1,21 @@
-Version 0.82.16930
+Version 0.83.xxxxx 
 
+    * Updated libvorbis to version 1.3.1
+    * Updated libogg to version 1.2.0
+    * Ogg Demux filter has been changed from a source + parser filter to just parser filter. This step allows usage of 
+       DirectShow's "File Source (Async.)" filter which give support of files bigger than 2GB, or "File Source (URL)" which
+       gives better networking support.
+    * HTML5 <video> plug-in has received a couple of improvements:
+        - URI support given by uriparser library
+        - VMR9 support (instead of VMR7), this requires DirectX9
+        - Internet Explorer Standards mode support, instead of just Quirks mode
+        - width and height basic attribute support
+
+Version 0.82.16930 - 22.02.2010
+
     * Updated Theora to version 1.1.1
     * Updated Vorbis to version 1.2.3
-    * Windows 7 suppport (note that contextual menu entries in Windows Explorer is not yet available - Ticket #1619)
+    * Windows 7 support (note that contextual menu entries in Windows Explorer is not yet available - Ticket #1619)
     * Added support for Theora 4:2:2 and 4:4:4 color sampling formats.
     * Added HTML5 <video> tag support for Microsoft Internet Explorer. This component is not enabled by default in the
        installer and it is only a technical preview - only basic playback (play/pause by left click button), no seeking, no

Modified: trunk/oggdsf/build/NSIS/Release/build.cmd
===================================================================
--- trunk/oggdsf/build/NSIS/Release/build.cmd	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/build/NSIS/Release/build.cmd	2010-05-03 22:38:42 UTC (rev 17188)
@@ -10,7 +10,7 @@
 set SVN_REVISION=%SVN_REVISION_FULL:~-5%
 del revision_text
 
-set PRODUCT_VERSION=0.82.%SVN_REVISION%
+set PRODUCT_VERSION=0.83.%SVN_REVISION%
 set OGGCODECS_ROOT_DIR=..\..\..
 
 @set FILTERS=dsfFLACEncoder dsfNativeFLACSource dsfFLACDecoder

Modified: trunk/oggdsf/build/NSIS/Release/oggcodecs_release.nsi
===================================================================
--- trunk/oggdsf/build/NSIS/Release/oggcodecs_release.nsi	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/build/NSIS/Release/oggcodecs_release.nsi	2010-05-03 22:38:42 UTC (rev 17188)
@@ -110,7 +110,7 @@
 VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${PRODUCT_NAME}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${PRODUCT_PUBLISHER}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "${PRODUCT_WEB_SITE}"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) 2008 - 2009 ${PRODUCT_PUBLISHER}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (c) 2008 - 2010 ${PRODUCT_PUBLISHER}"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "The Xiph Fish Logo and the Vorbis.com many-fish logos are trademarks (tm) of ${PRODUCT_PUBLISHER}"
 
 ; Language Selection Dialog Settings
@@ -515,29 +515,35 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;	Directshow extension to filter mapping - 8
+;;;  Mapped to File Source (Async.), except for FLAC
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  WriteRegStr HKCR "Media Type\Extensions\.anx" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "Media Type\Extensions\.axa" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "Media Type\Extensions\.axv" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
+  WriteRegStr HKCR "Media Type\Extensions\.anx" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "Media Type\Extensions\.axa" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "Media Type\Extensions\.axv" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
   WriteRegStr HKCR "Media Type\Extensions\.flac" "Source Filter" "{6DDA37BA-0553-499a-AE0D-BEBA67204548}"
-  WriteRegStr HKCR "Media Type\Extensions\.oga" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "Media Type\Extensions\.ogg" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "Media Type\Extensions\.ogv" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "Media Type\Extensions\.spx" "Source Filter" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
+  WriteRegStr HKCR "Media Type\Extensions\.oga" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "Media Type\Extensions\.ogg" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "Media Type\Extensions\.ogv" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "Media Type\Extensions\.spx" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}"
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;	Directshow extension to filter mapping for HTTP - 7
+;;;  Mapped to File Source (URL)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  WriteRegStr HKCR "http\Extensions" ".OGG" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".OGV" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".OGA" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".SPX" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".ANX" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".AXV" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
-  WriteRegStr HKCR "http\Extensions" ".AXA" "{C9361F5A-3282-4944-9899-6D99CDC5370B}"
+  WriteRegStr HKCR "http\Extensions" ".OGG" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".OGV" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".OGA" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".SPX" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".ANX" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".AXV" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
+  WriteRegStr HKCR "http\Extensions" ".AXA" "{E436EBB6-524F-11CE-9F53-0020AF0BA770}"
   
+  ;; Add the "OggS" recognition pattern
+  WriteRegStr HKCR "Media Type\{E436EB83-524F-11CE-9F53-0020AF0BA770}\{DD142C1E-0C1E-4381-A24E-0B2D80B6098A}" "0" "0,4,,4F676753"
+  WriteRegStr HKCR "Media Type\{E436EB83-524F-11CE-9F53-0020AF0BA770}\{DD142C1E-0C1E-4381-A24E-0B2D80B6098A}" "Source Filter" "{E436EBB5-524F-11CE-9F53-0020AF0BA770}";
+  
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;	MLS Perceived type - 7
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -910,7 +916,10 @@
   DeleteRegValue HKCR "Applications\wmplayer.exe\supportedtypes" ".ogv"
   DeleteRegValue HKCR "Applications\wmplayer.exe\supportedtypes" ".spx"
   DeleteRegValue HKCR "Applications\wmplayer.exe\supportedtypes" ".flac"
-  
+
+  ; Delete the "OggS" regonition pattern
+  DeleteRegKey HKCR "Media Type\{E436EB83-524F-11CE-9F53-0020AF0BA770}\{DD142C1E-0C1E-4381-A24E-0B2D80B6098A}"
+
   ; Delete the AxPlayer XMLNamespace registry value
   DeleteRegValue HKLM "SOFTWARE\Microsoft\Internet Explorer\XMLNamespace" "http://www.w3.org/1999/xhtml/video" 
 

Modified: trunk/oggdsf/sln/oggdsf_vs2005/oggdsf.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_vs2005/oggdsf.sln	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/sln/oggdsf_vs2005/oggdsf.sln	2010-05-03 22:38:42 UTC (rev 17188)
@@ -2,11 +2,11 @@
 # Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfCMMLDecoder", "..\..\src\lib\codecs\cmml\dsfCMMLDecoder\dsfCMMLDecoder-2005.vcproj", "{6B269BA6-6A18-41EF-A82C-03B6B5D4BCA7}"
 	ProjectSection(ProjectDependencies) = postProject
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
-		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject
 		Debug.AspNetCompiler.Debug = "True"
@@ -15,11 +15,11 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfCMMLRawSource", "..\..\src\lib\codecs\cmml\dsfCMMLRawSource\dsfCMMLRawSource-2005.vcproj", "{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}"
 	ProjectSection(ProjectDependencies) = postProject
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
-		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
 		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject
 		Debug.AspNetCompiler.Debug = "True"
@@ -28,8 +28,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libFLACHelper", "..\..\src\lib\codecs\flac\libs\libFLACHelper\libFLACHelper-2005.vcproj", "{7F213248-16F2-4AAE-B941-C402670082BC}"
 	ProjectSection(ProjectDependencies) = postProject
+		{4CEFBC83-C215-11DB-8314-0800200C9A66} = {4CEFBC83-C215-11DB-8314-0800200C9A66}
 		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
-		{4CEFBC83-C215-11DB-8314-0800200C9A66} = {4CEFBC83-C215-11DB-8314-0800200C9A66}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject
 		Debug.AspNetCompiler.Debug = "True"
@@ -38,13 +38,13 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfAnxMux", "..\..\src\lib\core\directshow\dsfAnxMux\dsfAnxMux-2005.vcproj", "{685D495F-1620-459A-9EE3-BAD4F619B2C2}"
 	ProjectSection(ProjectDependencies) = postProject
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
+		{6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834} = {6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834}
+		{2EBA839A-CE6E-406E-9A43-CC6FB25A78CB} = {2EBA839A-CE6E-406E-9A43-CC6FB25A78CB}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{2EBA839A-CE6E-406E-9A43-CC6FB25A78CB} = {2EBA839A-CE6E-406E-9A43-CC6FB25A78CB}
-		{6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834} = {6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834}
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject
 		Debug.AspNetCompiler.Debug = "True"
@@ -73,11 +73,11 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfNativeFLACSource", "..\..\src\lib\codecs\flac\filters\dsfNativeFLACSource\dsfNativeFLACSource-2005.vcproj", "{43DEE58F-CEC6-49B4-BC06-3D28978BAB63}"
 	ProjectSection(ProjectDependencies) = postProject
+		{4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D} = {4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D}
+		{4CEFBC83-C215-11DB-8314-0800200C9A66} = {4CEFBC83-C215-11DB-8314-0800200C9A66}
+		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
-		{4CEFBC83-C215-11DB-8314-0800200C9A66} = {4CEFBC83-C215-11DB-8314-0800200C9A66}
-		{4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D} = {4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libDirectshowAbstracts", "..\..\src\lib\core\directshow\libDirectshowAbstracts\libDirectshowAbstracts-2005.vcproj", "{EA7091BB-9906-41DF-9738-F4858A136086}"
@@ -86,87 +86,96 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOggMux", "..\..\src\lib\core\directshow\dsfOggMux\dsfOggMux-2005.vcproj", "{2EBA839A-CE6E-406E-9A43-CC6FB25A78CB}"
 	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfFLACDecoder", "..\..\src\lib\codecs\flac\filters\dsfFLACDecoder\dsfFLACDecoder-2005.vcproj", "{DE1073F1-71D6-477E-A7C1-6E4F0AACCBF4}"
+	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D} = {4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
+		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfFLACDecoder", "..\..\src\lib\codecs\flac\filters\dsfFLACDecoder\dsfFLACDecoder-2005.vcproj", "{DE1073F1-71D6-477E-A7C1-6E4F0AACCBF4}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfFLACEncoder", "..\..\src\lib\codecs\flac\filters\dsfFLACEncoder\dsfFLACEncoder-2005.vcproj", "{7143478E-0C1A-4C8B-B12C-4BFEF591F36F}"
 	ProjectSection(ProjectDependencies) = postProject
-		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D} = {4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfFLACEncoder", "..\..\src\lib\codecs\flac\filters\dsfFLACEncoder\dsfFLACEncoder-2005.vcproj", "{7143478E-0C1A-4C8B-B12C-4BFEF591F36F}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOggDemux2", "..\..\src\lib\core\directshow\dsfOggDemux2\dsfOggDemux2-2005.vcproj", "{304B710A-7355-471C-A4A8-9E8F6D640E6D}"
 	ProjectSection(ProjectDependencies) = postProject
-		{7F213248-16F2-4AAE-B941-C402670082BC} = {7F213248-16F2-4AAE-B941-C402670082BC}
-		{4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D} = {4AB55B4D-8F56-40CF-9AFA-7C161EE1B99D}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{4CEFBC85-C215-11DB-8314-0800200C9A66} = {4CEFBC85-C215-11DB-8314-0800200C9A66}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOggDemux2", "..\..\src\lib\core\directshow\dsfOggDemux2\dsfOggDemux2-2005.vcproj", "{304B710A-7355-471C-A4A8-9E8F6D640E6D}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOggSeek", "..\..\src\lib\core\ogg\libOOOggSeek\libOOOggSeek-2005.vcproj", "{9A14F6AC-BC6E-401A-A300-07369BD6C5FE}"
 	ProjectSection(ProjectDependencies) = postProject
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOggSeek", "..\..\src\lib\core\ogg\libOOOggSeek\libOOOggSeek-2005.vcproj", "{9A14F6AC-BC6E-401A-A300-07369BD6C5FE}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOgg", "..\..\src\lib\core\ogg\libOOOgg\libOOOgg-2005.vcproj", "{223ACC19-608E-4E1B-A054-067F0CACB272}"
 	ProjectSection(ProjectDependencies) = postProject
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOgg", "..\..\src\lib\core\ogg\libOOOgg\libOOOgg-2005.vcproj", "{223ACC19-608E-4E1B-A054-067F0CACB272}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOGMDecoder", "..\..\src\lib\codecs\ogm\filters\dsfOGMDecoder\dsfOGMDecoder-2005.vcproj", "{1C4F9412-B1DE-4E65-96C1-89522EF02997}"
 	ProjectSection(ProjectDependencies) = postProject
-		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfOGMDecoder", "..\..\src\lib\codecs\ogm\filters\dsfOGMDecoder\dsfOGMDecoder-2005.vcproj", "{1C4F9412-B1DE-4E65-96C1-89522EF02997}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSpeexDecoder", "..\..\src\lib\codecs\speex\filters\dsfSpeexDecoder\dsfSpeexDecoder-2005.vcproj", "{3FB9B20E-790A-402F-A02C-B0FBDC5938E3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4}
+		{359DBC2D-2BF1-4A1A-BE81-248268F557CC} = {359DBC2D-2BF1-4A1A-BE81-248268F557CC}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSpeexDecoder", "..\..\src\lib\codecs\speex\filters\dsfSpeexDecoder\dsfSpeexDecoder-2005.vcproj", "{3FB9B20E-790A-402F-A02C-B0FBDC5938E3}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSpeexEncoder", "..\..\src\lib\codecs\speex\filters\dsfSpeexEncoder\dsfSpeexEncoder-2005.vcproj", "{419E0701-9C9A-4671-B3B6-79FA206DEE25}"
 	ProjectSection(ProjectDependencies) = postProject
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
 		{359DBC2D-2BF1-4A1A-BE81-248268F557CC} = {359DBC2D-2BF1-4A1A-BE81-248268F557CC}
 		{E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4}
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSpeexEncoder", "..\..\src\lib\codecs\speex\filters\dsfSpeexEncoder\dsfSpeexEncoder-2005.vcproj", "{419E0701-9C9A-4671-B3B6-79FA206DEE25}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSubtitleVMR9", "..\..\src\lib\core\directshow\dsfSubtitleVMR9\dsfSubtitleVMR9-2005.vcproj", "{88532BA9-1EED-421F-84BF-88A7A87FB2D3}"
 	ProjectSection(ProjectDependencies) = postProject
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4} = {E972C52F-9E85-4D65-B19C-031E511E9DB4}
-		{359DBC2D-2BF1-4A1A-BE81-248268F557CC} = {359DBC2D-2BF1-4A1A-BE81-248268F557CC}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSubtitleVMR9", "..\..\src\lib\core\directshow\dsfSubtitleVMR9\dsfSubtitleVMR9-2005.vcproj", "{88532BA9-1EED-421F-84BF-88A7A87FB2D3}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfTheoraDecoder", "..\..\src\lib\codecs\theora\filters\dsfTheoraDecoder\dsfTheoraDecoder-2005.vcproj", "{11CBDFD6-0D73-40C0-95DF-997C5FD873F2}"
 	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{6B20BD7A-644B-4087-9CAC-71B2D68D0231} = {6B20BD7A-644B-4087-9CAC-71B2D68D0231}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfTheoraDecoder", "..\..\src\lib\codecs\theora\filters\dsfTheoraDecoder\dsfTheoraDecoder-2005.vcproj", "{11CBDFD6-0D73-40C0-95DF-997C5FD873F2}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfTheoraEncoder", "..\..\src\lib\codecs\theora\filters\dsfTheoraEncoder\dsfTheoraEncoder-2005.vcproj", "{8C91066F-5C96-48BB-BD1F-D30FFD2A57A1}"
 	ProjectSection(ProjectDependencies) = postProject
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
@@ -175,42 +184,33 @@
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfTheoraEncoder", "..\..\src\lib\codecs\theora\filters\dsfTheoraEncoder\dsfTheoraEncoder-2005.vcproj", "{8C91066F-5C96-48BB-BD1F-D30FFD2A57A1}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfVorbisDecoder", "..\..\src\lib\codecs\vorbis\filters\dsfVorbisDecoder\dsfVorbisDecoder-2005.vcproj", "{C2B7DBC0-5AB3-46F5-90E9-05EF1B230AE2}"
 	ProjectSection(ProjectDependencies) = postProject
+		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{6B20BD7A-644B-4087-9CAC-71B2D68D0231} = {6B20BD7A-644B-4087-9CAC-71B2D68D0231}
 		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfVorbisDecoder", "..\..\src\lib\codecs\vorbis\filters\dsfVorbisDecoder\dsfVorbisDecoder-2005.vcproj", "{C2B7DBC0-5AB3-46F5-90E9-05EF1B230AE2}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfVorbisEncoder", "..\..\src\lib\codecs\vorbis\filters\dsfVorbisEncoder\dsfVorbisEncoder-2005.vcproj", "{D74A626E-C8CB-4787-913E-2E637FC04F2B}"
 	ProjectSection(ProjectDependencies) = postProject
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
+		{C97A67F9-B786-41FA-9FC9-13167FE2BA49} = {C97A67F9-B786-41FA-9FC9-13167FE2BA49}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfVorbisEncoder", "..\..\src\lib\codecs\vorbis\filters\dsfVorbisEncoder\dsfVorbisEncoder-2005.vcproj", "{D74A626E-C8CB-4787-913E-2E637FC04F2B}"
-	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{3A214E06-B95E-4D61-A291-1F8DF2EC10FD} = {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
-		{EA7091BB-9906-41DF-9738-F4858A136086} = {EA7091BB-9906-41DF-9738-F4858A136086}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{C97A67F9-B786-41FA-9FC9-13167FE2BA49} = {C97A67F9-B786-41FA-9FC9-13167FE2BA49}
-		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libAnxHelper", "..\..\src\lib\helper\libAnxHelper\libAnxHelper-2005.vcproj", "{6F8DE2AB-BF7A-4A4C-96F0-52BE1D992834}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCMMLParse", "..\..\src\lib\codecs\cmml\libCMMLParse\libCMMLParse-2005.vcproj", "{899EB7AD-26BF-4495-9BE5-EADECCC288B2}"
 	ProjectSection(ProjectDependencies) = postProject
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
-		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCMMLTags", "..\..\src\lib\codecs\cmml\libCMMLTags\libCMMLTags-2005.vcproj", "{AD38DCC6-B431-4B32-8569-74F3376EF2DA}"
@@ -219,21 +219,21 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOggChef", "..\..\src\lib\helper\libOOOggChef\libOOOggChef-2005.vcproj", "{3D55194E-6732-4A74-A947-EDFF585A0F19}"
 	ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
+		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
+		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
-		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
-		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
-		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOSpeex", "..\..\src\lib\codecs\speex\libs\libOOSpeex\libOOSpeex-2005.vcproj", "{359DBC2D-2BF1-4A1A-BE81-248268F557CC}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOTheora", "..\..\src\lib\codecs\theora\libs\libOOTheora\libOOTheora-2005.vcproj", "{6B20BD7A-644B-4087-9CAC-71B2D68D0231}"
 	ProjectSection(ProjectDependencies) = postProject
+		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
+		{653F3841-3F26-49B9-AFCF-091DB4B67031} = {653F3841-3F26-49B9-AFCF-091DB4B67031}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{653F3841-3F26-49B9-AFCF-091DB4B67031} = {653F3841-3F26-49B9-AFCF-091DB4B67031}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
-		{15CBFEFF-7965-41F5-B4E2-21E8795C9159} = {15CBFEFF-7965-41F5-B4E2-21E8795C9159}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOTremor", "..\..\src\lib\codecs\vorbis\libs\libOOTremor\libOOTremor-2005.vcproj", "{620C8CE0-D182-4C0E-B83E-05656ECA971B}"
@@ -255,8 +255,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libVorbisComment", "..\..\src\lib\core\ogg\libVorbisComment\libVorbisComment-2005.vcproj", "{DC4D86E2-72C1-4995-8FB1-0F08655E620A}"
 	ProjectSection(ProjectDependencies) = postProject
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
-		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libWinCMMLParse", "..\..\src\lib\codecs\cmml\libWinCMMLParse\libWinCMMLParse-2005.vcproj", "{23BAAF7B-AEC3-4812-AA91-7E5061E83A39}"

Modified: trunk/oggdsf/sln/oggdsf_vs2008/oggdsf.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_vs2008/oggdsf.sln	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/sln/oggdsf_vs2008/oggdsf.sln	2010-05-03 22:38:42 UTC (rev 17188)
@@ -4,8 +4,8 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
 		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
-		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject
@@ -16,9 +16,9 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfCMMLRawSource", "..\..\src\lib\codecs\cmml\dsfCMMLRawSource\dsfCMMLRawSource.vcproj", "{35D263B8-C0C4-4F28-AC6D-07F8C82A01B8}"
 	ProjectSection(ProjectDependencies) = postProject
 		{4CBC0173-27E6-4218-AE06-5EFDCA7B2547} = {4CBC0173-27E6-4218-AE06-5EFDCA7B2547}
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
 		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
 		{899EB7AD-26BF-4495-9BE5-EADECCC288B2} = {899EB7AD-26BF-4495-9BE5-EADECCC288B2}
-		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 	ProjectSection(WebsiteProperties) = preProject

Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -2,8 +2,10 @@
 
 #include <string>
 #include <map>
-#include <libCMMLParse/libCMMLParse.h>
-#include <libCMMLParse/CMMLParser.h>
+//#include <libCMMLParse/libCMMLParse.h>
+//#include <libCMMLParse/CMMLParser.h>
+#include <libWinCMMLParse/libWinCMMLParse.h>
+#include <libWinCMMLParse/CMMLParser.h>
 #include <libTemporalURI/C_TimeStamp.h>
 #include "CMMLRawSourcePin.h"
 using namespace std;

Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -39,8 +39,10 @@
 // that uses this DLL. This way any other project whose source files include this file see 
 // LIBWINCMMLPARSE_API functions as being imported from a DLL, whereas this DLL sees symbols
 // defined with this macro as being exported.
-#ifdef LIBWINCMMLPARSE_EXPORTS
-#define LIBWINCMMLPARSE_API __declspec(dllexport)
-#else
-#define LIBWINCMMLPARSE_API __declspec(dllimport)
-#endif
+
+#define LIBWINCMMLPARSE_API
+// #ifdef LIBWINCMMLPARSE_EXPORTS
+// #define LIBWINCMMLPARSE_API __declspec(dllexport)
+// #else
+// #define LIBWINCMMLPARSE_API __declspec(dllimport)
+// #endif

Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -42,7 +42,7 @@
 {
 public:
     //Constants
-    static const unsigned long NUM_BUFFERS = 4;
+    static const unsigned long NUM_BUFFERS = 16;
 
 public:
     //COM Stuff

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -297,6 +297,11 @@
 
 HRESULT TheoraDecodeFilter::CheckInputType(const CMediaType* inMediaType) 
 {
+    LOG(logDEBUG) << __FUNCTIONW__ << "\tMajortype: " << inMediaType->majortype;
+    LOG(logDEBUG) << __FUNCTIONW__ << "\tSubtype: " << inMediaType->subtype;
+    LOG(logDEBUG) << __FUNCTIONW__ << "\tFormattype: " << inMediaType->formattype;
+    LOG(logDEBUG) << __FUNCTIONW__ << "\tcbFormat: " << inMediaType->cbFormat;
+
 	if	( inMediaType->majortype == MEDIATYPE_OggPacketStream &&
 		  inMediaType->subtype == MEDIASUBTYPE_None && 
           inMediaType->formattype == FORMAT_OggIdentHeader)
@@ -306,12 +311,20 @@
 			if (strncmp((char*)inMediaType->pbFormat, "\200theora", 7) == 0) 
             {
 				//TODO::: Possibly verify version
-				LOG(logDEBUG) << "Input type ok";
+				LOG(logDEBUG) << __FUNCTIONW__ << " Input type ok";
 				return S_OK;
 			}
 		}
 	}
 
+    LOG(logDEBUG) << __FUNCTIONW__ << " Input type not ok.";
+    if (inMediaType->cbFormat > 7)
+    {
+        char format[8] = {};
+        strncpy(format, reinterpret_cast<const char*>(inMediaType->pbFormat), 7);
+        LOG(logDEBUG) << __FUNCTIONW__ << " cbFormat start: " << format;
+    }
+
 	return S_FALSE;
 }
 
@@ -468,6 +481,8 @@
 
 HRESULT TheoraDecodeFilter::GetMediaType(int inPosition, CMediaType* outOutputMediaType) 
 {
+    LOG(logDEBUG) << __FUNCTIONW__ << " inPosition: " << inPosition;
+
 	if (inPosition < 0) 
 	{
 		return E_INVALIDARG;

Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -62,21 +62,23 @@
 	CAutoLock locLock(m_pLock);
 	//Need a lock ??
 	ReleaseDelegate();
-	//LOG(logDEBUG) << "Break connect";
-	return CTransformOutputPin::BreakConnect();
+	LOG(logDEBUG) << __FUNCTIONW__;
+	
+    return CTransformOutputPin::BreakConnect();
 }
 
 HRESULT TheoraDecodeOutputPin::CompleteConnect (IPin *inReceivePin) 
 {
 	CAutoLock locLock(m_pLock);
-	//LOG(logDEBUG) << "Complete connect";
+	LOG(logDEBUG) << __FUNCTIONW__;
+
 	IMediaSeeking* locSeeker = NULL;
 
 	m_pFilter->GetPin(0)->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
 
 	if (locSeeker == NULL) 
     {
-		//LOG(logDEBUG) << "Seeker was NULL";
+		LOG(logDEBUG) << __FUNCTIONW__ << "Seeker was NULL";
 	}
 
 	SetDelegate(locSeeker);

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -118,137 +118,146 @@
 {
 	CAutoLock locLock(mStreamLock);
 
-	HRESULT locHR = CheckStreaming();
+	HRESULT hr = CheckStreaming();
 
-	if (locHR == S_OK) 
+	if (hr != S_OK) 
     {
-		BYTE* locBuff = NULL;
-		locHR = inSample->GetPointer(&locBuff);
+        //Not streaming - Bail out.
+        return S_FALSE;
+    }
 
-		if (locHR != S_OK) 
+	BYTE* buffer = NULL;
+	hr = inSample->GetPointer(&buffer);
+
+	if (hr != S_OK) 
+    {
+        LOG(logERROR) << __FUNCTIONW__ << " inSample->GetPointer failed, error code: 0x" << std::hex << hr;
+		return hr;
+	} 
+
+	REFERENCE_TIME tStart = -1;
+	REFERENCE_TIME tStop = -1;
+	__int64 sampleDuration = 0;
+	inSample->GetTime(&tStart, &tStop);
+
+	hr = TransformData(buffer, inSample->GetActualDataLength());
+	if (hr != S_OK) 
+    {
+		return S_FALSE;
+	}
+	if (tStop > 0) 
+    {
+		//Can dump it all downstream now	
+		IMediaSample* sample;
+		unsigned long bytesCopied = 0;
+		unsigned long bytesToCopy = 0;
+
+		tStart = convertGranuleToTime(tStop) - (((mDecodedByteCount / mFrameSize) * UNITS) / mSampleRate);
+
+		REFERENCE_TIME globalOffset = 0;
+		//Handle stream offsetting
+		if (!mSentStreamOffset && (mOggOutputPinInterface != NULL)) 
         {
-			//TODO::: Do a debug dump or something here with specific error info.
-			return locHR;
-		} 
-        else 
+			mOggOutputPinInterface->notifyStreamBaseTime(tStart);
+			mSentStreamOffset = true;	
+		}
+
+		if (mOggOutputPinInterface != NULL) 
         {
-			REFERENCE_TIME locStart = -1;
-			REFERENCE_TIME locEnd = -1;
-			__int64 locSampleDuration = 0;
-			inSample->GetTime(&locStart, &locEnd);
+			globalOffset = mOggOutputPinInterface->getGlobalBaseTime();
+		}
 
-			HRESULT locResult = TransformData(locBuff, inSample->GetActualDataLength());
-			if (locResult != S_OK) 
+		do 
+        {
+			HRESULT hr = mOutputPin->GetDeliveryBuffer(&sample, NULL, NULL, NULL);
+			if (hr != S_OK) 
             {
-				return S_FALSE;
+				return hr;
 			}
-			if (locEnd > 0) 
+
+			BYTE* locBuffer = NULL;
+			hr = sample->GetPointer(&locBuffer);
+		
+			if (hr != S_OK) 
             {
-				//Can dump it all downstream now	
-				IMediaSample* locSample;
-				unsigned long locBytesCopied = 0;
-				unsigned long locBytesToCopy = 0;
+				return hr;
+			}
 
-				locStart = convertGranuleToTime(locEnd) - (((mDecodedByteCount / mFrameSize) * UNITS) / mSampleRate);
+            LOG(logDEBUG4) << __FUNCTIONW__ << " Sample Size: " << sample->GetSize();
+			bytesToCopy = sample->GetSize();
+            
+            if (mDecodedByteCount - bytesCopied < sample->GetSize()) 
+            {
+                bytesToCopy = mDecodedByteCount - bytesCopied;
+            }
 
-				REFERENCE_TIME locGlobalOffset = 0;
-				//Handle stream offsetting
-				if (!mSentStreamOffset && (mOggOutputPinInterface != NULL)) 
-                {
-					mOggOutputPinInterface->notifyStreamBaseTime(locStart);
-					mSentStreamOffset = true;	
-				}
+            LOG(logDEBUG4) << __FUNCTIONW__ << " Bytes to copy: " << bytesToCopy;
+			LOG(logDEBUG4) << __FUNCTIONW__ << " Actual Buffer count = " << mOutputPin->actualBufferCount();
+			//bytesCopied += bytesToCopy;
 
-				if (mOggOutputPinInterface != NULL) {
-					locGlobalOffset = mOggOutputPinInterface->getGlobalBaseTime();
-				}
+			sampleDuration = (((bytesToCopy/mFrameSize) * UNITS) / mSampleRate);
+			tStop = tStart + sampleDuration;
 
-				do 
+			//Adjust the time stamps for rate and seeking
+			REFERENCE_TIME adjustedStart = (tStart * RATE_DENOMINATOR) / mRateNumerator;
+			REFERENCE_TIME adjustedStop = (tStop * RATE_DENOMINATOR) / mRateNumerator;
+			adjustedStart -= (m_tStart + globalOffset);
+			adjustedStop -= (m_tStart + globalOffset);
+
+			__int64 seekStripOffset = 0;
+			if (adjustedStop < 0) 
+            {
+				sample->Release();
+			} 
+            else 
+            {
+				if (adjustedStart < 0) 
                 {
-					HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
-					if (locHR != S_OK) 
-                    {
-						return locHR;
-					}
+					seekStripOffset = (-adjustedStart) * mSampleRate;
+					seekStripOffset *= mFrameSize;
+					seekStripOffset /= UNITS;
+					seekStripOffset += (mFrameSize - (seekStripOffset % mFrameSize));
+					__int64 strippedDuration = (((seekStripOffset/mFrameSize) * UNITS) / mSampleRate);
+					adjustedStart += strippedDuration;
+				}					
 
-					BYTE* locBuffer = NULL;
-					locHR = locSample->GetPointer(&locBuffer);
-				
-					if (locHR != S_OK) 
-                    {
-						return locHR;
-					}
+                LOG(logDEBUG4) << __FUNCTIONW__ << " Seek strip offset: " << seekStripOffset;
 
-					LOG(logDEBUG4) << "Sample Size = " << locSample->GetSize();
-					locBytesToCopy = ((mDecodedByteCount - locBytesCopied) <= locSample->GetSize()) ? (mDecodedByteCount - locBytesCopied) : locSample->GetSize();
-					LOG(logDEBUG4) << "Filled size = " << locBytesToCopy;
-					LOG(logDEBUG4) << "Actual Buffer count = " << mOutputPin->actualBufferCount();
-					//locBytesCopied += locBytesToCopy;
+                if (bytesToCopy - seekStripOffset < 0)
+                {
+                    sample->Release();
+                }
+                else
+                {
+				    //memcpy((void*)locBuffer, (const void*)&mDecodedBuffer[bytesCopied + seekStripOffset], bytesToCopy - seekStripOffset);
+                    reorderChannels(locBuffer, &mDecodedBuffer[bytesCopied + seekStripOffset], bytesToCopy - seekStripOffset);
 
-					locSampleDuration = (((locBytesToCopy/mFrameSize) * UNITS) / mSampleRate);
-					locEnd = locStart + locSampleDuration;
-
-					//Adjust the time stamps for rate and seeking
-					REFERENCE_TIME locAdjustedStart = (locStart * RATE_DENOMINATOR) / mRateNumerator;
-					REFERENCE_TIME locAdjustedEnd = (locEnd * RATE_DENOMINATOR) / mRateNumerator;
-					locAdjustedStart -= (m_tStart + locGlobalOffset);
-					locAdjustedEnd -= (m_tStart + locGlobalOffset);
-
-					__int64 locSeekStripOffset = 0;
-					if (locAdjustedEnd < 0) 
+				    sample->SetTime(&adjustedStart, &adjustedStop);
+				    sample->SetMediaTime(&tStart, &tStop);
+				    sample->SetSyncPoint(TRUE);
+				    sample->SetActualDataLength(bytesToCopy - seekStripOffset);
+				    hr = ((VorbisDecodeOutputPin*)(mOutputPin))->mDataQueue->Receive(sample);
+				    if (hr != S_OK) 
                     {
-						locSample->Release();
-					} 
-                    else 
-                    {
-						if (locAdjustedStart < 0) 
-                        {
-							locSeekStripOffset = (-locAdjustedStart) * mSampleRate;
-							locSeekStripOffset *= mFrameSize;
-							locSeekStripOffset /= UNITS;
-							locSeekStripOffset += (mFrameSize - (locSeekStripOffset % mFrameSize));
-							__int64 locStrippedDuration = (((locSeekStripOffset/mFrameSize) * UNITS) / mSampleRate);
-							locAdjustedStart += locStrippedDuration;
-						}
-							
+					    return hr;
+				    }
+				    tStart += sampleDuration;
+                }
+			}
+			bytesCopied += bytesToCopy;
 
-						//memcpy((void*)locBuffer, (const void*)&mDecodedBuffer[locBytesCopied + locSeekStripOffset], locBytesToCopy - locSeekStripOffset);
-                        reorderChannels(locBuffer, &mDecodedBuffer[locBytesCopied + locSeekStripOffset], locBytesToCopy - locSeekStripOffset);
+		
+		} while(bytesCopied < mDecodedByteCount);
 
-						locSample->SetTime(&locAdjustedStart, &locAdjustedEnd);
-						locSample->SetMediaTime(&locStart, &locEnd);
-						locSample->SetSyncPoint(TRUE);
-						locSample->SetActualDataLength(locBytesToCopy - locSeekStripOffset);
-						locHR = ((VorbisDecodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample);
-						if (locHR != S_OK) 
-                        {
-							return locHR;
-						}
-						locStart += locSampleDuration;
-
-					}
-					locBytesCopied += locBytesToCopy;
-
-				
-				} while(locBytesCopied < mDecodedByteCount);
-
-				mDecodedByteCount = 0;
-				
-			}
-			return S_OK;
-
-		}
-	} 
-    else 
-    {
-		//Not streaming - Bail out.
-		return S_FALSE;
+		mDecodedByteCount = 0;
+		
 	}
+	return S_OK;
 }
 
 void VorbisDecodeInputPin::reorderChannels(unsigned char* inDestBuffer, const unsigned char* inSourceBuffer, unsigned long inNumBytes)
 {
-    //memcpy((void*)locBuffer, (const void*)&mDecodedBuffer[locBytesCopied + locSeekStripOffset], locBytesToCopy - locSeekStripOffset);
+    //memcpy((void*)locBuffer, (const void*)&mDecodedBuffer[bytesCopied + seekStripOffset], bytesToCopy - seekStripOffset);
 
     if (((VorbisDecodeFilter*)m_pFilter)->USE_CORRECT_VORBIS_CHANNEL_MAPPING && 
         (mNumChannels == 6  || mNumChannels == 3 || mNumChannels == 5)) 

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -45,7 +45,7 @@
 {
 public:
 
-    static const unsigned long NUM_BUFFERS = 4;
+    static const unsigned long NUM_BUFFERS = 16;
 
 	friend class VorbisDecodeInputPin;
 

Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -40,10 +40,11 @@
 // Windows Header Files:
 #include <windows.h>
 
+#include <atlbase.h>
+#include <atlcom.h>
+
 #include <libOOOgg/libOOOgg.h>
 
-#include <fstream>
-
 #include "AbstractTransformFilter.h"
 #include "AbstractTransformInputPin.h"
 #include "AbstractTransformOutputPin.h"
@@ -57,9 +58,6 @@
 
 #include "common/Log.h"
 
-#include <atlbase.h>
-#include <atlcom.h>
-
 #ifndef LOOG_INT64
 # ifdef WIN32
 #  define LOOG_INT64 signed __int64

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,62 +1,57 @@
 #include "StdAfx.h"
 #include "CustomOggChainGranuleSeekTable.h"
+#undef min
 
-CustomOggChainGranuleSeekTable::CustomOggChainGranuleSeekTable(IFilterDataSource* inDataSource)
+CustomOggChainGranuleSeekTable::CustomOggChainGranuleSeekTable()
 	:	AutoOggChainGranuleSeekTable(TEXT(""))
-	,	mCustomSource(inDataSource)
 {
 
 }
 
-CustomOggChainGranuleSeekTable::~CustomOggChainGranuleSeekTable(void)
+CustomOggChainGranuleSeekTable::~CustomOggChainGranuleSeekTable()
 {
 }
 
 bool CustomOggChainGranuleSeekTable::buildTable()
 {
-	//if (mFilename.find("http") != 0) {
-	//	
-	//	//mSeekMap.clear();
-	//	//addSeekPoint(0, 0);
+    return true;
+}
 
-	//	mFile.open(mFilename.c_str(), ios_base::in | ios_base::binary);
-	//	//TODO::: Error check
-	//	const unsigned long BUFF_SIZE = 4096;
-	//	unsigned char* locBuff = new unsigned char[BUFF_SIZE];		//Deleted this function.
-	//	while (!mFile.eof()) {
-	//		mFile.read((char*)locBuff, BUFF_SIZE);
-	//		mOggDemux->feed((const unsigned char*)locBuff, mFile.gcount());
-	//	}
-	//	delete[] locBuff;
+bool CustomOggChainGranuleSeekTable::buildTable(IAsyncReader* inReader)
+{
+    LONGLONG total = 0;
+    LONGLONG available = 0;
+    if (FAILED(inReader->Length(&total, &available)) || total > available)
+    {
+        return false;
+    }
 
-	//	mFile.close();
-	//	mIsEnabled = true;
-	//	
-	//} else {
-	//	mIsEnabled = false;
-	//}
-	//return true;
+    const LONGLONG BUFFER_SIZE = 4096;
+    unsigned char* buffer = new unsigned char[BUFFER_SIZE];
 
-	mCustomSource->seek(0);
+    bool isEnabled = true;
+    LONGLONG position = 0;
+    
+    while (position < total) 
+    {
+        // This construction is needed because IAsyncReader::SyncRead
+        // doesn't report the number of bytes actually read.
+        LONG bytesToRead = static_cast<LONG>(std::min(BUFFER_SIZE, total - position));
+        if (inReader->SyncRead(position, bytesToRead, buffer) == S_OK) 
+        {
+            if (mOggDemux->feed(buffer, bytesToRead) == OggDataBuffer::FEED_OK) 
+            {
+                position += bytesToRead;
+                continue;
+            }
+        }
+        //An error has occured.
+        isEnabled = false;
+        break;
+    }
 
-	if (mCustomSource->isError() || mCustomSource->isEOF()) {
-		return false;
-	} else {
-		const unsigned long BUFF_SIZE = 4096;
-		unsigned char* locBuff = new unsigned char[BUFF_SIZE];		//Deleted this function.
-		unsigned long locReadCount = 0;
-		while (!mCustomSource->isEOF()) {
-			locReadCount = mCustomSource->read((char*)locBuff, BUFF_SIZE);
-			mOggDemux->feed((const unsigned char*)locBuff, locReadCount);
-		}
-		delete[] locBuff;
+    delete[] buffer;
+    mIsEnabled = isEnabled;	
 
-
-		mIsEnabled = true;	
-	
-		mCustomSource->clear();
-		mCustomSource->seek(0);
-		return true;
-	}
-
-}
\ No newline at end of file
+    return isEnabled;
+}

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/CustomOggChainGranuleSeekTable.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,16 +1,13 @@
 #pragma once
 
-#include "IFilterDataSource.h"
-class CustomOggChainGranuleSeekTable
-	:	public AutoOggChainGranuleSeekTable
+#include "libOOOggSeek/AutoOggChainGranuleSeekTable.h"
+
+class CustomOggChainGranuleSeekTable : public AutoOggChainGranuleSeekTable
 {
 public:
-	CustomOggChainGranuleSeekTable(IFilterDataSource* inDataSource);
-	virtual ~CustomOggChainGranuleSeekTable(void);
+	CustomOggChainGranuleSeekTable();
+	virtual ~CustomOggChainGranuleSeekTable();
 
 	virtual bool buildTable();
-
-protected:
-	IFilterDataSource* mCustomSource;
-
+    virtual bool buildTable(IAsyncReader* inReader);
 };

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,98 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "datasourcefactory.h"
-
-DataSourceFactory::DataSourceFactory(void)
-{
-}
-
-DataSourceFactory::~DataSourceFactory(void)
-{
-}
-
-IFilterDataSource* DataSourceFactory::createDataSource(wstring inSourceLocation) {
-	wstring locType = identifySourceType(inSourceLocation);
-
-	if(locType.length() == 1) {
-		//File...
-		return new FilterFileSource;
-	} else if (locType == L"\\\\") {
-		//Network share...
-		return new FilterFileSource;
-	} else if (locType == L"http") {
-		//Http stream
-		//return new HTTPFileSource;
-		return new HTTPStreamingFileSource;
-#ifdef WINCE
-	} else if (locType == L"\\") {
-		//WinCE absolute file path
-		return new FilterFileSource;
-#endif
-	} else {
-		//Something else
-		return NULL;
-	}
-}
-
-wstring DataSourceFactory::identifySourceType(wstring inSourceLocation) {
-	size_t locPos = inSourceLocation.find(':');
-	if (locPos == string::npos) {
-		//No colon... not a normal file. See if it's a network share...
-
-		//Make sure it's long enough...
-		if (inSourceLocation.length() > 2) {
-			wstring retStr = inSourceLocation.substr(0,2);
-			if (retStr == L"\\\\") {
-				//A "\\" is a network share
-				return retStr;
-			} else {
-#ifdef WINCE
-				retStr = inSourceLocation.substr(0,1);
-
-				if (retStr == L"\\") {
-					//WinCE absolute path
-					return retStr;
-				}
-#endif
-				//Not a network share.
-				return L"";
-			}
-		} else {
-			//Too short
-			return L"";
-		}
-	} else {
-		wstring retStr = inSourceLocation.substr(0,locPos);
-		return retStr;
-	}
-	
-}
\ No newline at end of file

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/DataSourceFactory.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,45 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "IFilterDataSource.h"
-#include "FilterFileSource.h"
-#include "HTTPFileSource.h"
-
-#include "HTTPStreamingFileSource.h"
-class OGG_DEMUX2_API DataSourceFactory
-{
-public:
-	DataSourceFactory(void);
-	~DataSourceFactory(void);
-
-	static IFilterDataSource* createDataSource(wstring inSourceLocation);
-	static wstring identifySourceType(wstring inSourceLocation);
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,65 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003-2006 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "filterfilesource.h"
-
-FilterFileSource::FilterFileSource(void)
-{
-}
-
-FilterFileSource::~FilterFileSource(void)
-{
-	mSourceFile.close();
-}
-
-unsigned long FilterFileSource::seek(unsigned long inPos) 
-{
-	mSourceFile.clear();
-	mSourceFile.seekg(inPos, ios_base::beg);
-	return mSourceFile.tellg();
-}
-void FilterFileSource::close() {
-	mSourceFile.close();
-}
-bool FilterFileSource::open(wstring inSourceLocation, unsigned long) {
-	mSourceFile.open(inSourceLocation.c_str(), ios_base::in|ios_base::binary);
-	return mSourceFile.is_open();
-}
-void FilterFileSource::clear() {
-	mSourceFile.clear();
-}
-bool FilterFileSource::isEOF() {
-	return mSourceFile.eof();
-}
-unsigned long FilterFileSource::read(char* outBuffer, unsigned long inNumBytes) {
-	mSourceFile.read(outBuffer, inNumBytes);
-	return mSourceFile.gcount();
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/FilterFileSource.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,58 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include <fstream>
-#include <string>
-
-using namespace std;
-#include "IFilterDataSource.h"
-class OGG_DEMUX2_API FilterFileSource
-	:	public IFilterDataSource
-{
-public:
-	FilterFileSource(void);
-	virtual ~FilterFileSource(void);
-
-	//IFilterDataSource Interface
-	virtual unsigned long seek(unsigned long inPos);
-	virtual void close();
-	virtual bool open(wstring inSourceLocation, unsigned long inStartByte = 0);
-	virtual void clear();
-	virtual bool isEOF();
-	virtual bool isError()								{	return false;	}
-	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
-	virtual wstring shouldRetryAt()						{		return L"";		}
-	//
-
-protected:
-	fstream mSourceFile;
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,466 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "httpfilesource.h"
-
-//#define OGGCODECS_LOGGING
-HTTPFileSource::HTTPFileSource(void)
-	:	mBufferLock(NULL)
-	,	mIsChunked(false)
-	,	mIsFirstChunk(true)
-	,	mChunkRemains(0)
-	,	mNumLeftovers(0)
-{
-	mBufferLock = new CCritSec;
-#ifdef OGGCODECS_LOGGING
-	debugLog.open("d:\\zen\\logs\\htttp.log", ios_base::out | ios_base::app);
-	fileDump.open("d:\\zen\\logs\\filedump.ogg", ios_base::out|ios_base::binary);
-	rawDump.open("D:\\zen\\logs\\rawdump.out", ios_base::out|ios_base::binary);
-#endif
-	mInterBuff = new unsigned char[RECV_BUFF_SIZE* 2];
-
-}
-
-HTTPFileSource::~HTTPFileSource(void)
-{
-	//debugLog<<"About to close socket"<<endl;
-	close();
-	//debugLog<<"Winsock ended"<<endl;
-#ifdef OGGCODECS_LOGGING
-	debugLog.close();
-	fileDump.close();
-	rawDump.close();
-#endif
-	delete mBufferLock;
-	delete[] mInterBuff;
-}
-
-void HTTPFileSource::unChunk(unsigned char* inBuff, unsigned long inNumBytes) 
-{
-
-	//This method is a bit rough and ready !!
-	ASSERT(inNumBytes > 2);
-	rawDump.write((char*)inBuff, inNumBytes);
-	//debugLog<<"UnChunk"<<endl;
-	unsigned long locNumBytesLeft = inNumBytes;
-
-	memcpy((void*)(mInterBuff + mNumLeftovers), (const void*)inBuff, inNumBytes);
-	locNumBytesLeft +=  mNumLeftovers;
-	mNumLeftovers = 0;
-	unsigned char* locWorkingBuffPtr = mInterBuff;
-
-	//debugLog<<"inNumBytes = "<<inNumBytes<<endl;
-
-	while (locNumBytesLeft > 8) {
-		//debugLog<<"---"<<endl;
-		//debugLog<<"Bytes left = "<<locNumBytesLeft<<endl;
-		//debugLog<<"ChunkRemaining = "<<mChunkRemains<<endl;
-
-		if (mChunkRemains == 0) {
-			//debugLog<<"Zero bytes of chunk remains"<<endl;
-
-			//Assign to a string for easy manipulation of the hex size
-			string locTemp;
-		
-			if (mIsFirstChunk) {
-				//debugLog<<"It's the first chunk"<<endl;
-				mIsFirstChunk = false;
-				locTemp = (char*)locWorkingBuffPtr;
-			} else {
-				//debugLog<<"Not the first chunk"<<endl;
-				//debugLog<<"Skip bytes = "<<(int)locWorkingBuffPtr[0]<<(int)locWorkingBuffPtr[1]<<endl;
-				locTemp = (char*)(locWorkingBuffPtr + 2);
-				locWorkingBuffPtr+=2;
-				locNumBytesLeft -= 2;
-			}
-
-	/*		if (mLeftOver != "") {
-				debugLog<<"Sticking the leftovers back together..."<<endl;
-				locTemp = mLeftOver + locTemp;
-				mLeftOver = "";
-			}*/
-
-			size_t locChunkSizePos = locTemp.find("\r\n");
-			
-			
-			if (locChunkSizePos != string::npos) {
-				//debugLog<<"Found the size bytes "<<endl;
-				//Get a string representation of the hex string that tells us the size of the chunk
-				string locChunkSizeStr = locTemp.substr(0, locChunkSizePos);
-				//debugLog<<"Sizingbuytes " << locChunkSizeStr<<endl;
-				char* locDummyPtr = NULL;
-
-				//Convert it to a number
-				mChunkRemains = strtol(locChunkSizeStr.c_str(), &locDummyPtr, 16);
-
-				//debugLog<<"Chunk reamining "<<mChunkRemains<<endl;
-				//The size of the crlf 's and the chunk size value
-				unsigned long locGuffSize = (unsigned long)(locChunkSizeStr.size() + 2);
-				locWorkingBuffPtr +=  locGuffSize;
-				locNumBytesLeft -= locGuffSize;
-			} else {
-				//debugLog<<"************************************** "<<endl;
-			
-
-			}
-		}
-
-		//This is the end of file
-		if (mChunkRemains == 0) {
-			//debugLog<<"EOF"<<endl;
-			return;
-		}
-
-		//If theres less bytes than the remainder of the chunk
-		if (locNumBytesLeft < mChunkRemains) {
-			//debugLog<<"less bytes remain than the chunk needs"<<endl;
-			
-			mFileCache.write((const unsigned char*)locWorkingBuffPtr, locNumBytesLeft );
-			fileDump.write((char*)locWorkingBuffPtr, locNumBytesLeft);
-			locWorkingBuffPtr += locNumBytesLeft;
-			mChunkRemains -= locNumBytesLeft;
-			locNumBytesLeft = 0;
-		} else {
-			//debugLog<<"more bytes remain than the chunk needs"<<endl;
-			mFileCache.write((const unsigned char*)locWorkingBuffPtr, mChunkRemains );
-			fileDump.write((char*)locWorkingBuffPtr, mChunkRemains);
-			locWorkingBuffPtr += mChunkRemains;
-			locNumBytesLeft -= mChunkRemains;
-			mChunkRemains = 0;
-		}
-
-	}
-
-	if (locNumBytesLeft != 0) {
-		//debugLog<<"There is a non- zero amount of bytes leftover... buffer them up for next time..."<<endl;
-		memcpy((void*)mInterBuff, (const void*)locWorkingBuffPtr, locNumBytesLeft);
-		mNumLeftovers = locNumBytesLeft;
-	}
-}
-void HTTPFileSource::DataProcessLoop() {
-	//debugLog<<"DataProcessLoop: "<<endl;
-	int locNumRead = 0;
-	char* locBuff = NULL;
-	DWORD locCommand = 0;
-	bool locSeenAny = false;
-	debugLog<<"Starting dataprocessloop"<<endl;
-
-	locBuff = new char[RECV_BUFF_SIZE];
-
-	while(true) {
-		if(CheckRequest(&locCommand) == TRUE) {
-			debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
-			delete[] locBuff;
-			return;
-		}
-		//debugLog<<"About to call recv"<<endl;
-		locNumRead = recv(mSocket, locBuff, RECV_BUFF_SIZE, 0);
-		//debugLog<<"recv complete"<<endl;
-		if (locNumRead == SOCKET_ERROR) {
-			int locErr = WSAGetLastError();
-			debugLog<<"Socket error receiving - Err No = "<<locErr<<endl;
-			mWasError = true;
-			break;
-		}
-
-		if (locNumRead == 0) {
-			debugLog<<"Read last bytes..."<<endl;
-			mIsEOF = true;
-			delete[] locBuff;
-			return;
-		}
-
-		{//CRITICAL SECTION - PROTECTING BUFFER STATE
-			CAutoLock locLock(mBufferLock);
-			//debugLog <<"Num Read = "<<locNumRead<<endl;
-			if (mSeenResponse) {
-				//Add to buffer
-
-				if (mIsChunked) {
-					unChunk((unsigned char*)locBuff, locNumRead);
-				} else {
-					mFileCache.write((const unsigned char*)locBuff, locNumRead);
-				}
-			
-				//Dump to file
-				//fileDump.write(locBuff, locNumRead);
-			} else {
-				//if (!locSeenAny) {
-				//	locSeenAny = true;
-				//	//Start of response
-				//	if (locBuff[0] != '2') {
-				//		mWasError = true;
-				//		delete[] locBuff;
-				//		return;
-				//	}
-				//}
-				string locTemp = locBuff;
-				//debugLog<<"Binary follows... "<<endl<<locTemp<<endl;
-				size_t locPos = locTemp.find("\r\n\r\n");
-				if (locPos != string::npos) {
-					//Found the break
-					//debugLog<<"locPos = "<<locPos<<endl;
-					mSeenResponse = true;
-					mLastResponse = locTemp.substr(0, locPos);
-					debugLog<<"HTTP Response:"<<endl;
-					debugLog<<mLastResponse<<endl;
-
-					unsigned short locResponseCode = getHTTPResponseCode(mLastResponse);
-
-					mRetryAt = "";
-					if (locResponseCode == 301) {
-						size_t locLocPos = mLastResponse.find("Location: ");
-						if (locLocPos != string::npos) {
-							locLocPos += 10;
-							size_t locEndPos = mLastResponse.find("\r", locLocPos);
-							if (locEndPos != string::npos) {
-								if (locEndPos > locLocPos) {
-									mRetryAt = mLastResponse.substr(locLocPos, locEndPos - locLocPos);
-									debugLog<<"Retry URL = "<<mRetryAt<<endl;
-								}
-							}
-						}
-
-						debugLog<<"Setting error to true"<<endl;
-						mIsEOF = true;
-						mWasError = true;
-						//close();
-					} else if (locResponseCode >= 300) {
-						debugLog<<"Setting error to true"<<endl;
-						mIsEOF = true;
-						mWasError = true;
-						//close();
-					}
-
-					if (locTemp.find("Transfer-Encoding: chunked") != string::npos) {
-						mIsChunked = true;
-					}
-
-					char* locBuff2 = locBuff + locPos + 4;  //View only - don't delete.
-					locTemp = locBuff2;
-
-					if (mIsChunked) {
-						if (locNumRead - locPos - 4 > 0) {
-							unChunk((unsigned char*)locBuff2, locNumRead - locPos - 4);
-						}
-					} else {
-                        //debugLog<<"Start of data follows"<<endl<<locTemp<<endl;
-						if (locNumRead - locPos - 4 > 0) {
-							mFileCache.write((const unsigned char*)locBuff2, (locNumRead - (locPos + 4)));
-						}
-					}
-				}
-			}
-		} //END CRITICAL SECTION
-	}
-
-	delete[] locBuff;
-}
-
-unsigned short HTTPFileSource::getHTTPResponseCode(string inHTTPResponse)
-{
-	size_t locPos = inHTTPResponse.find(" ");
-	if (locPos != string::npos) {
-		string locCodeString = inHTTPResponse.substr(locPos + 1, 3);
-		try {
-			unsigned short locCode = (unsigned short)StringHelper::stringToNum(locCodeString);
-			return locCode;
-		} catch(...) {
-			return 0;
-		}
-	} else {
-		return 0;
-	}
-}
-string HTTPFileSource::shouldRetryAt()
-{
-	return mRetryAt;
-}
-
-DWORD HTTPFileSource::ThreadProc(void) {
-	//debugLog<<"ThreadProc:"<<endl;
-	while(true) {
-		DWORD locThreadCommand = GetRequest();
-		
-		switch(locThreadCommand) {
-			case THREAD_EXIT:
-				
-				Reply(S_OK);
-				return S_OK;
-
-			case THREAD_RUN:
-				
-				Reply(S_OK);
-				DataProcessLoop();
-				break;
-				//return S_OK;
-		}
-
-
-	}
-	return S_OK;
-}
-unsigned long HTTPFileSource::seek(unsigned long inPos) {
-	//Close the socket down
-	//Open up a new one to the same place.
-	//Make the partial content request.
-	//debugLog<<"Seeking to "<<inPos<<endl;
-	if (mFileCache.readSeek(inPos)) {
-		return inPos;
-	} else {
-		return (unsigned long) -1;
-	}
-	
-}
-
-
-void HTTPFileSource::close() {
-	//Killing thread
-	//debugLog<<"HTTPFileSource::close()"<<endl;
-	if (ThreadExists() == TRUE) {
-		//debugLog<<"Calling Thread to EXIT"<<endl;
-		CallWorker(THREAD_EXIT);
-		//debugLog<<"Killing thread..."<<endl;
-		Close();
-		//debugLog<<"After Close called on CAMThread"<<endl;
-	}
-
-
-	
-	//debugLog<<"Closing socket..."<<endl;
-	//Close the socket down.
-	closeSocket();
-}
-
-bool HTTPFileSource::startThread() {
-	if (ThreadExists() == FALSE) {
-		Create();
-	}
-	CallWorker(THREAD_RUN);
-	return true;
-}
-bool HTTPFileSource::open(string inSourceLocation, unsigned long inStartByte) {
-	//Open network connection and start feeding data into a buffer
-	//
-	mSeenResponse = false;
-	mLastResponse = "";
-	//debugLog<<"Open: "<<inSourceLocation<<endl;
-
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		
-		//Init rand number generator
-		LARGE_INTEGER locTicks;
-		QueryPerformanceCounter(&locTicks);
-		srand((unsigned int)locTicks.LowPart);
-
-		int locRand = rand();
-
-		string locCacheFileName = getenv("TEMP");
-		//debugLog<<"Temp = "<<locCacheFileName<<endl;
-		locCacheFileName += "\\filecache";
-		
-		locCacheFileName += StringHelper::numToString(locRand);
-		locCacheFileName += ".ogg";
-		//debugLog<<"Cache file  = "<<locCacheFileName<<endl;
-		if(mFileCache.open(locCacheFileName)) {
-			//debugLog<<"OPEN : Cach file opened"<<endl;
-		}
-	} //END CRITICAL SECTION
-
-	bool locIsOK = setupSocket(inSourceLocation);
-
-	if (!locIsOK) {
-		//debugLog<<"Setup socket FAILED"<<endl;
-		closeSocket();
-		return false;
-	}
-
-	//debugLog<<"Sending request..."<<endl;
-
-	//How is filename already set ??
-	httpRequest(assembleRequest(mFileName));
-	//debugLog<<"Socket ok... starting thread"<<endl;
-	locIsOK = startThread();
-
-
-	return locIsOK;
-}
-void HTTPFileSource::clear() {
-	//Reset flags.
-	debugLog<<"Setting error to false";
-	mIsEOF = false;
-	mWasError = false;
-	mRetryAt = "";
-}
-bool HTTPFileSource::isError()
-{
-	return mWasError;
-}
-bool HTTPFileSource::isEOF() {
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		unsigned long locSizeBuffed = mFileCache.bytesAvail();;
-	
-		//debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
-		if ((locSizeBuffed == 0) && mIsEOF) {
-			//debugLog<<"isEOF : It is EOF"<<endl;
-			return true;
-		} else {
-			//debugLog<<"isEOF : It's not EOF"<<endl;
-			return false;
-		}
-	} //END CRITICAL SECTION
-
-}
-unsigned long HTTPFileSource::read(char* outBuffer, unsigned long inNumBytes) {
-	//Reads from the buffer, will return 0 if nothing in buffer.
-	// If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
-
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		
-		//debugLog<<"Read:"<<endl;
-		if((mFileCache.bytesAvail() == 0) || mWasError) {
-			//debugLog<<"read : Can't read is error or eof"<<endl;
-			return 0;
-		} else {
-			//debugLog<<"Reading from buffer"<<endl;
-			
-			unsigned long locNumRead = mFileCache.read((unsigned char*)outBuffer, inNumBytes);
-
-			if (locNumRead > 0) {
-				debugLog<<locNumRead<<" bytes read from buffer"<<endl;
-			}
-			return locNumRead;
-		}
-	} //END CRITICAL SECTION
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPFileSource.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,92 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-
-#include "HTTPSocket.h"
-#include "SingleMediaFileCache.h"
-#include "IFilterDataSource.h"
-#include <string>
-#include <sstream>
-#include <fstream>
-
-using namespace std;
-
-class OGG_DEMUX2_API HTTPFileSource
-	:	public IFilterDataSource
-	,	public CAMThread
-	,	protected HTTPSocket	
-{
-public:
-	HTTPFileSource(void);
-	virtual ~HTTPFileSource(void);
-
-	//Thread commands
-	static const int THREAD_RUN = 0;
-	static const int THREAD_EXIT = 1;
-
-	//IFilterDataSource Interface
-	virtual unsigned long seek(unsigned long inPos);
-	virtual void close() ;
-	virtual bool open(string inSourceLocation, unsigned long inStartByte = 0);
-	virtual void clear();
-	virtual bool isEOF();
-	virtual bool isError();
-	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
-	virtual wstring shouldRetryAt();
-
-	//CAMThread pure virtuals
-	DWORD HTTPFileSource::ThreadProc();
-
-protected:
-	void unChunk(unsigned char* inBuff, unsigned long inNumBytes);
-	unsigned short getHTTPResponseCode(string inHTTPResponse);
-	bool startThread();
-	void DataProcessLoop();
-
-	SingleMediaFileCache mFileCache;
-
-	bool mIsChunked;
-	unsigned long mChunkRemains;
-
-	bool mIsFirstChunk;
-	string mRetryAt;
-
-	fstream debugLog;
-	fstream fileDump;
-	fstream rawDump;
-
-	unsigned char* mInterBuff;
-	unsigned long mNumLeftovers;
-	static	const unsigned long RECV_BUFF_SIZE = 1024;
-
-	CCritSec* mBufferLock;
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,224 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include ".\httpsocket.h"
-
-HTTPSocket::HTTPSocket(void)
-	:	mWasError(false)
-	,	mIsEOF(false)
-	,	mIsOpen(false)
-	,	mSeenResponse(false)
-{
-	//debugLog2.open("G:\\logs\\httpsocket.log", ios_base::out);
-
-	//Setup the socket API
-	WORD locWinsockVersion = MAKEWORD(1,1);
-	WSADATA locWinsockData;
-	int locRet= 0;
-
-	locRet = WSAStartup(locWinsockVersion, &locWinsockData);
-	if ((locRet != 0) || (locWinsockData.wVersion != locWinsockVersion)) {
-		//Failed to setup.
-		//debugLog2<<"Failed to start winsock V "<<locWinsockData.wVersion<<endl;
-		WSACleanup();
-		throw 0;
-	}
-
-	//debugLog2<<"Winsock started"<<endl;
-}
-
-HTTPSocket::~HTTPSocket(void)
-{
-	//debugLog2<<"Winsock ended"<<endl;
-	//debugLog2.close();
-	
-	WSACleanup();
-}
-
-
-bool HTTPSocket::setupSocket(string inSourceLocation) 
-{
-
-	mSourceLocation = inSourceLocation;
-	//debugLog2<<"Setup Socket:"<<endl;
-	IN_ADDR locAddress;  //iaHost
-	LPHOSTENT locHostData;;  //lpHost
-
-	bool locValidURL = splitURL(inSourceLocation);
-
-    locAddress.S_un.S_addr = inet_addr(mServerName.c_str());
-	
-
-	if (locAddress.S_un.S_addr == INADDR_NONE) {
-		locHostData = gethostbyname(mServerName.c_str());
-	} else {
-		locHostData = gethostbyaddr((const char*)&locAddress, sizeof(struct in_addr), AF_INET);
-	}
-
-
-
-	if (locHostData == NULL) {
-		//debugLog2<<"LocHostData is NULL"<<endl;
-		//Failed
-		return false;
-	}
-
-	mSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (mSocket == INVALID_SOCKET) {
-		//debugLog2<<"Socket Invalid"<<endl;
-		//Failed
-		return false;
-	}
-
-
-	LPSERVENT locServiceData; //lpServEnt
-	SOCKADDR_IN locServiceSocketAddr; //saServer
-	
-	if (mPort == 0) {
-#ifdef WINCE
-		locServiceSocketAddr.sin_port = htons(80);
-#else
-		locServiceData = getservbyname("http", "tcp");
-		if (locServiceData == NULL) {
-			locServiceSocketAddr.sin_port = htons(80);
-		} else {
-			locServiceSocketAddr.sin_port = locServiceData->s_port;
-		}
-#endif
-	} else {
-		//Explicit port
-		locServiceSocketAddr.sin_port = htons(mPort);
-	}
-
-
-
-	locServiceSocketAddr.sin_family = AF_INET;
-	locServiceSocketAddr.sin_addr = *((LPIN_ADDR)*locHostData->h_addr_list);
-
-
-	int locRetVal = 0;
-	locRetVal = connect(mSocket, (LPSOCKADDR)&locServiceSocketAddr, sizeof(SOCKADDR_IN));
-	if (locRetVal == SOCKET_ERROR) {
-		//debugLog2<<"Failed to connect..."<<endl;
-		closesocket(mSocket);
-		return false;
-	}
-
-	return true;
-
-
-}
-
-string HTTPSocket::assembleRequest(string inFilePath, unsigned long inStartByte) {
-	string retRequest;
-	retRequest = "GET " + inFilePath+ " HTTP/1.1\r\n" + "Host: " + mServerName+ "\r\n" + "Connection: close";
-	
-	if (inStartByte != 0) {
-		retRequest = retRequest + "\r\n" + "Range: bytes=" + StringHelper::numToString(inStartByte) + "-";
-	}
-	
-	retRequest += "\r\n\r\n";
-	//debugLog2<<"Assembled Req : "<<endl<<retRequest<<endl;
-	return retRequest;
-}
-
-bool HTTPSocket::httpRequest(string inRequest) {
-	//debugLog2<<"Http Request:"<<endl;
-	int locRetVal = send(mSocket, inRequest.c_str(), (int)inRequest.length(), 0);
-
-	if (locRetVal == SOCKET_ERROR) {
-		//debugLog2<<"Socket error on send"<<endl;
-		closesocket(mSocket);
-		return false;
-	}
-	return true;
-}
-
-bool HTTPSocket::splitURL(string inURL) 
-{
-	//UNICODE::: Note explicit ansi usage in this method
-	//debugLog2<<"Split url:"<<endl;
-	string locProtocol;
-	string locServerName;
-	string locPath;
-	string locPort;
-	string locTemp;
-	size_t locPos2;
-	size_t locPos = inURL.find(':');
-	if (locPos == string::npos) {
-		//No colon... not a url or file... failure.
-		return false;
-	} else {
-		locProtocol = inURL.substr(0, locPos);
-		locTemp = inURL.substr(locPos+1);
-		locPos = locTemp.find("//");
-		if ((locPos == string::npos) || (locPos != 0)) {
-			return false;
-		} else {
-            locTemp = locTemp.substr(locPos+2);
-			locPos = locTemp.find('/');
-			if (locPos == string::npos) {
-				return false;
-			} else {
-				locPos2 = locTemp.find(':');
-				if (locPos2 == string::npos) {
-					locServerName = locTemp.substr(0, locPos);
-					locPath = locTemp.substr(locPos);
-				} else if (locPos2 < locPos) {
-					//Explicit port specification
-					locPort = locTemp.substr(locPos2 + 1, locPos - locPos2 - 1);
-					locServerName = locTemp.substr(0, locPos2);
-					locPath = locTemp.substr(locPos);
-				}
-
-			}
-		}
-		
-	}
-
-	mServerName = locServerName;
-	mFileName = locPath;
-	if (locPort != "") {
-		//TODO::: Error checking needed
-		//UNICODE::: Note explicit ansi usage in this method
-		mPort = atoiA(locPort.c_str());
-	} else {
-		mPort = 0;
-	}
-	//debugLog2<<"Proto : "<<locProtocol<<endl<<"Server : "<<locServerName<<endl<<" Path : "<<mFileName<<" Port : "<<mPort<<endl;
-	return true;
-
-}
-void HTTPSocket::closeSocket() {
-	//debugLog2<<"Close Socket:"<<endl;
-	int ret = closesocket(mSocket);
-	ret = ret;
-}
\ No newline at end of file

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPSocket.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,65 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <fstream>
-#include <string>
-#include <winsock.h>
-using namespace std;
-
-class OGG_DEMUX2_API HTTPSocket
-{
-public:
-	HTTPSocket(void);
-	virtual ~HTTPSocket(void);
-
-	virtual bool setupSocket(string inSourceLocation);
-	virtual void closeSocket();
-	virtual bool splitURL(string inURL);
-	virtual string assembleRequest(string inFilePath, unsigned long inStartByte = 0);
-	//virtual string assembleRequest(string inFilePath);
-	bool httpRequest(string inRequest);
-protected:
-	string mServerName;
-	string mFileName;
-	unsigned short mPort;
-	string mLastResponse;
-	SOCKET mSocket;
-
-	string mSourceLocation;
-
-	bool mIsEOF;
-	bool mWasError;
-	bool mIsOpen;
-	bool mSeenResponse;
-
-	//fstream debugLog2;
-
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,626 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "HTTPStreamingFileSource.h"
-
-//#define OGGCODECS_LOGGING
-HTTPStreamingFileSource::HTTPStreamingFileSource(void)
-	:	mBufferLock(NULL)
-	,	mIsChunked(false)
-	,	mIsFirstChunk(true)
-	,	mChunkRemains(0)
-	,	mNumLeftovers(0)
-	,	mCurrentAbsoluteReadPosition(0)
-	,	mMemoryBuffer(NULL)
-	,	mContentLength(-1)
-	,	mIsBufferFilling(false)
-	,	mFirstPass(true)
-	,	mStreamStartBuffer(NULL)
-	,	mStreamStartBufferLength(0)
-	,	mApparentReadPosition(0)
-{
-	mBufferLock = new CCritSec;
-#ifdef OGGCODECS_LOGGING
-	debugLog.open("d:\\zen\\logs\\htttp.log", ios_base::out | ios_base::app);
-	fileDump.open("d:\\zen\\logs\\filedump.ogg", ios_base::out|ios_base::binary);
-	rawDump.open("D:\\zen\\logs\\rawdump.out", ios_base::out|ios_base::binary);
-#endif
-	
-	mInterBuff = new unsigned char[RECV_BUFF_SIZE* 2];
-	mMemoryBuffer = new CircularBuffer(MEMORY_BUFFER_SIZE);
-	mStreamStartBuffer = new unsigned char[STREAM_START_BUFFER_SIZE];
-
-}
-
-HTTPStreamingFileSource::~HTTPStreamingFileSource(void)
-{
-	//debugLog<<"About to close socket"<<endl;
-	close();
-	//debugLog<<"Winsock ended"<<endl;
-#ifdef OGGCODECS_LOGGING
-	debugLog.close();
-	fileDump.close();
-	rawDump.close();
-#endif
-	delete mBufferLock;
-	delete[] mInterBuff;
-
-	delete mMemoryBuffer;
-	delete[] mStreamStartBuffer;
-}
-
-void HTTPStreamingFileSource::unChunk(unsigned char* inBuff, unsigned long inNumBytes) 
-{
-
-	//This method is a bit rough and ready !!
-	ASSERT(inNumBytes > 2);
-	rawDump.write((char*)inBuff, inNumBytes);
-	debugLog<<"UnChunk"<<endl;
-	unsigned long locNumBytesLeft = inNumBytes;
-
-	memcpy((void*)(mInterBuff + mNumLeftovers), (const void*)inBuff, inNumBytes);
-	locNumBytesLeft +=  mNumLeftovers;
-	mNumLeftovers = 0;
-	unsigned char* locWorkingBuffPtr = mInterBuff;
-
-	debugLog<<"inNumBytes = "<<inNumBytes<<endl;
-
-	while (locNumBytesLeft > 8) {
-		debugLog<<"---"<<endl;
-		debugLog<<"Bytes left = "<<locNumBytesLeft<<endl;
-		debugLog<<"ChunkRemaining = "<<mChunkRemains<<endl;
-
-		if (mChunkRemains == 0) {
-			debugLog<<"Zero bytes of chunk remains"<<endl;
-
-			//Assign to a string for easy manipulation of the hex size
-			string locTemp;
-		
-			if (mIsFirstChunk) {
-				debugLog<<"+++++++++++++++ It's the first chunk ++++++++++++"<<endl;
-				mIsFirstChunk = false;
-				locTemp = (char*)locWorkingBuffPtr;
-			} else {
-				debugLog<<"Not the first chunk"<<endl;
-				debugLog<<"Skip bytes = "<<(int)locWorkingBuffPtr[0]<<(int)locWorkingBuffPtr[1]<<endl;
-				locTemp = (char*)(locWorkingBuffPtr + 2);
-				locWorkingBuffPtr+=2;
-				locNumBytesLeft -= 2;
-			}
-
-	/*		if (mLeftOver != "") {
-				debugLog<<"Sticking the leftovers back together..."<<endl;
-				locTemp = mLeftOver + locTemp;
-				mLeftOver = "";
-			}*/
-
-			size_t locChunkSizePos = locTemp.find("\r\n");
-			
-			
-			if (locChunkSizePos != string::npos) {
-				debugLog<<"Found the size bytes "<<endl;
-				//Get a string representation of the hex string that tells us the size of the chunk
-				string locChunkSizeStr = locTemp.substr(0, locChunkSizePos);
-				debugLog<<"!!!!! Sizing bytes " << locChunkSizeStr<<endl;
-				char* locDummyPtr = NULL;
-
-				//Convert it to a number
-				mChunkRemains = strtol(locChunkSizeStr.c_str(), &locDummyPtr, 16);
-
-				//debugLog<<"Chunk reamining "<<mChunkRemains<<endl;
-				//The size of the crlf 's and the chunk size value
-				unsigned long locGuffSize = (unsigned long)(locChunkSizeStr.size() + 2);
-				locWorkingBuffPtr +=  locGuffSize;
-				locNumBytesLeft -= locGuffSize;
-			} else {
-				debugLog<<"******************* FAILED TO FIND SIZE BYTES "<<endl;
-			
-
-			}
-		}
-
-		//This is the end of file
-		if (mChunkRemains == 0) {
-			debugLog<<" ??? EOF ???"<<endl;
-			return;
-		}
-
-		debugLog<<"locNumBytesLeft = "<<locNumBytesLeft<<endl;
-		debugLog<<"mChunkRemains = "<<mChunkRemains<<endl;
-		//If theres less bytes than the remainder of the chunk
-		if (locNumBytesLeft < mChunkRemains) {
-			//debugLog<<"less bytes remain than the chunk needs"<<endl;
-			
-			mMemoryBuffer->write((const unsigned char*)locWorkingBuffPtr, locNumBytesLeft );
-			fileDump.write((char*)locWorkingBuffPtr, locNumBytesLeft);
-			locWorkingBuffPtr += locNumBytesLeft;
-			mChunkRemains -= locNumBytesLeft;
-			locNumBytesLeft = 0;
-		} else {
-			//debugLog<<"more bytes remain than the chunk needs"<<endl;
-			mMemoryBuffer->write((const unsigned char*)locWorkingBuffPtr, mChunkRemains );
-			fileDump.write((char*)locWorkingBuffPtr, mChunkRemains);
-			locWorkingBuffPtr += mChunkRemains;
-			locNumBytesLeft -= mChunkRemains;
-			mChunkRemains = 0;
-		}
-
-	}
-
-	if (locNumBytesLeft != 0) {
-		debugLog<<"There is a non- zero amount of bytes leftover... buffer them up for next time..."<<endl;
-		memcpy((void*)mInterBuff, (const void*)locWorkingBuffPtr, locNumBytesLeft);
-		mNumLeftovers = locNumBytesLeft;
-	}
-
-	//Debugging
-	if (strcmp((const char*)mInterBuff, "1000") == 0) {
-		debugLog<<"---- Probably failure point"<<endl;
-	}
-}
-void HTTPStreamingFileSource::DataProcessLoop() {
-	//debugLog<<"DataProcessLoop: "<<endl;
-	int locNumRead = 0;
-	char* locBuff = NULL;
-	DWORD locCommand = 0;
-	debugLog<<"Starting dataprocessloop"<<endl;
-
-	mIsBufferFilling = false;
-
-	locBuff = new char[RECV_BUFF_SIZE];
-
-	while(true) {
-		if (mMemoryBuffer->numBytesAvail() <= MEMORY_BUFFER_LOW_TIDE) {
-			//Need to keep reading
-			if(CheckRequest(&locCommand) == TRUE) {
-				if (GetRequest() == THREAD_EXIT) {
-					debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
-					delete[] locBuff;
-					return;
-				} else {
-					
-					Reply(S_OK);
-				}
-			}
-		} else {
-			//Got enough data, wait for a new job
-
-			mIsBufferFilling = false;
-			if (GetRequest() == THREAD_EXIT) {	//Block until we have a new job
-				debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
-				delete[] locBuff;
-				return;
-			} else {
-				Reply(S_OK);
-			}
-		}
-
-		mIsBufferFilling = true;
-		//if(CheckRequest(&locCommand) == TRUE) {
-		//	debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
-		//	delete[] locBuff;
-		//	return;
-		//}
-		//debugLog<<"About to call recv"<<endl;
-		locNumRead = recv(mSocket, locBuff, RECV_BUFF_SIZE, 0);
-		//debugLog<<"recv complete"<<endl;
-		if (locNumRead == SOCKET_ERROR) {
-			int locErr = WSAGetLastError();
-			debugLog<<"Socket error receiving - Err No = "<<locErr<<endl;
-			mWasError = true;
-			break;
-		}
-
-		if (locNumRead == 0) {
-			debugLog<<"Read last bytes..."<<endl;
-			mIsEOF = true;
-			delete[] locBuff;
-			return;
-		}
-
-		{//CRITICAL SECTION - PROTECTING BUFFER STATE
-			CAutoLock locLock(mBufferLock);
-			//debugLog <<"Num Read = "<<locNumRead<<endl;
-			if (mSeenResponse) {
-				//Add to buffer
-
-				if (mIsChunked) {
-					unChunk((unsigned char*)locBuff, locNumRead);
-				} else {
-					mMemoryBuffer->write((const unsigned char*)locBuff, locNumRead);
-				}
-			
-				//Dump to file
-				//fileDump.write(locBuff, locNumRead);
-			} else {
-				//if (!locSeenAny) {
-				//	locSeenAny = true;
-				//	//Start of response
-				//	if (locBuff[0] != '2') {
-				//		mWasError = true;
-				//		delete[] locBuff;
-				//		return;
-				//	}
-				//}
-				string locTemp = locBuff;
-				//debugLog<<"Binary follows... "<<endl<<locTemp<<endl;
-				size_t locPos = locTemp.find("\r\n\r\n");
-				if (locPos != string::npos) {
-					//Found the break
-					//debugLog<<"locPos = "<<locPos<<endl;
-					mSeenResponse = true;
-					mLastResponse = locTemp.substr(0, locPos);
-					debugLog<<"HTTP Response:"<<endl;
-					debugLog<<mLastResponse<<endl;
-
-					unsigned short locResponseCode = getHTTPResponseCode(mLastResponse);
-
-					mRetryAt = L"";
-					if (		(locResponseCode == 301)
-							||	(locResponseCode == 302)
-							||	(locResponseCode == 303)
-							||	(locResponseCode == 307)) {
-						size_t locLocPos = mLastResponse.find("Location: ");
-						if (locLocPos != string::npos) {
-							locLocPos += 10;
-							size_t locEndPos = mLastResponse.find("\r", locLocPos);
-							if (locEndPos != string::npos) {
-								if (locEndPos > locLocPos) {
-                                    mRetryAt = StringHelper::toWStr(mLastResponse.substr(locLocPos, locEndPos - locLocPos));
-									//debugLog<<"Retry URL = "<<mRetryAt<<endl;
-								}
-							}
-						}
-
-						debugLog<<"Setting error to true"<<endl;
-						mIsEOF = true;
-						mWasError = true;
-						//close();
-					} else if (locResponseCode >= 300) {
-						debugLog<<"Setting error to true"<<endl;
-						mIsEOF = true;
-						mWasError = true;
-						//close();
-					} else {
-						//Good response
-
-						//Check for content-length
-						mContentLength = -1;
-						size_t locContentLengthPos = mLastResponse.find("Content-Length: ");
-						if (locContentLengthPos != string::npos) {
-							locContentLengthPos += 16;
-
-							size_t locEndPos = mLastResponse.find("\r", locContentLengthPos);
-							if ((locEndPos != string::npos) && (locEndPos > locContentLengthPos)) {
-								string locLengthString = mLastResponse.substr(locContentLengthPos, locEndPos - locContentLengthPos);
-
-								
-								try {
-									__int64 locContentLength = StringHelper::stringToNum(locLengthString);
-									mContentLength = locContentLength;
-								} catch(...) {
-									mContentLength = -1;
-								}
-							}
-						}
-					}
-
-					if (locTemp.find("Transfer-Encoding: chunked") != string::npos) {
-						mIsChunked = true;
-					}
-
-					char* locBuff2 = locBuff + locPos + 4;  //View only - don't delete.
-					locTemp = locBuff2;
-
-					if (mIsChunked) {
-						if (locNumRead - locPos - 4 > 0) {
-							unChunk((unsigned char*)locBuff2, locNumRead - locPos - 4);
-						}
-					} else {
-                        //debugLog<<"Start of data follows"<<endl<<locTemp<<endl;
-						if (locNumRead - locPos - 4 > 0) {
-							mMemoryBuffer->write((const unsigned char*)locBuff2, (locNumRead - (locPos + 4)));
-						}
-					}
-				}
-			}
-		} //END CRITICAL SECTION
-	}
-
-	delete[] locBuff;
-}
-
-unsigned short HTTPStreamingFileSource::getHTTPResponseCode(string inHTTPResponse)
-{
-	size_t locPos = inHTTPResponse.find(" ");
-	if (locPos != string::npos) {
-		string locCodeString = inHTTPResponse.substr(locPos + 1, 3);
-		try {
-			unsigned short locCode = (unsigned short)StringHelper::stringToNum(locCodeString);
-			return locCode;
-		} catch(...) {
-			return 0;
-		}
-	} else {
-		return 0;
-	}
-}
-wstring HTTPStreamingFileSource::shouldRetryAt()
-{
-	return mRetryAt;
-}
-
-DWORD HTTPStreamingFileSource::ThreadProc(void) {
-	//debugLog<<"ThreadProc:"<<endl;
-	while(true) {
-		DWORD locThreadCommand = GetRequest();
-		
-		switch(locThreadCommand) {
-			case THREAD_EXIT:
-				
-				Reply(S_OK);
-				return S_OK;
-
-			case THREAD_RUN:
-				
-				Reply(S_OK);
-				DataProcessLoop();
-				break;
-				//return S_OK;
-		}
-
-
-	}
-	return S_OK;
-}
-unsigned long HTTPStreamingFileSource::seek(unsigned long inPos) 
-{
-	//Close the socket down
-	//Open up a new one to the same place.
-	//Make the partial content request.
-	//debugLog<<"Seeking to "<<inPos<<endl;
-
-	//Keep track of the absolute position we are looking at in the file.
-	
-	mFirstPass = false;
-	if (mCurrentAbsoluteReadPosition <= mStreamStartBufferLength) {
-		//The network stream is still within the start buffer
-		mApparentReadPosition = inPos;
-		return inPos;
-	} else {
-	
-		mCurrentAbsoluteReadPosition = inPos;
-	
-	
-	
-	
-	
-		if ((mContentLength != -1) || (inPos == 0)) {
-			close();
-			closeSocket();
-			clear();
-
-            open(StringHelper::toWStr(mSourceLocation), inPos);
-			return inPos;
-
-		} else {
-			return (unsigned long) -1;
-		}
-	}
-	//if (mFileCache.readSeek(inPos)) {
-	//	return inPos;
-	//} else {
-	//	return (unsigned long) -1;
-	//}
-	
-}
-
-
-void HTTPStreamingFileSource::close() {
-	//Killing thread
-	//debugLog<<"HTTPStreamingFileSource::close()"<<endl;
-	if (ThreadExists() == TRUE) {
-		//debugLog<<"Calling Thread to EXIT"<<endl;
-		CallWorker(THREAD_EXIT);
-		//debugLog<<"Killing thread..."<<endl;
-		Close();
-		//debugLog<<"After Close called on CAMThread"<<endl;
-	}
-
-
-	
-	//debugLog<<"Closing socket..."<<endl;
-	//Close the socket down.
-	closeSocket();
-}
-
-bool HTTPStreamingFileSource::startThread() {
-	if (ThreadExists() == FALSE) {
-		Create();
-	}
-	CallWorker(THREAD_RUN);
-	return true;
-}
-bool HTTPStreamingFileSource::open(wstring inSourceLocation, unsigned long inStartByte) {
-	//Open network connection and start feeding data into a buffer
-	//
-	mSeenResponse = false;
-	mLastResponse = "";
-	//debugLog<<"Open: "<<inSourceLocation<<endl;
-
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		
-		////Init rand number generator
-		//LARGE_INTEGER locTicks;
-		//QueryPerformanceCounter(&locTicks);
-		//srand((unsigned int)locTicks.LowPart);
-
-		//int locRand = rand();
-
-		//string locCacheFileName = getenv("TEMP");
-		////debugLog<<"Temp = "<<locCacheFileName<<endl;
-		//locCacheFileName += "\\filecache";
-		//
-		//locCacheFileName += StringHelper::numToString(locRand);
-		//locCacheFileName += ".ogg";
-		//debugLog<<"Cache file  = "<<locCacheFileName<<endl;
-		//if(mFileCache.open(locCacheFileName)) {
-		//	//debugLog<<"OPEN : Cach file opened"<<endl;
-		//}
-
-		mMemoryBuffer->reset();
-	} //END CRITICAL SECTION
-
-    bool locIsOK = setupSocket(StringHelper::toNarrowStr(inSourceLocation));
-
-	if (!locIsOK) {
-		//debugLog<<"Setup socket FAILED"<<endl;
-		closeSocket();
-		return false;
-	}
-
-	//debugLog<<"Sending request..."<<endl;
-
-	//How is filename already set ??
-	httpRequest(assembleRequest(mFileName, inStartByte));
-	//debugLog<<"Socket ok... starting thread"<<endl;
-	locIsOK = startThread();
-
-
-	return locIsOK;
-}
-void HTTPStreamingFileSource::clear() {
-	//Reset flags.
-	debugLog<<"Setting error to false";
-	mIsEOF = false;
-	mWasError = false;
-	mRetryAt = L"";
-	mIsFirstChunk = true;
-	mChunkRemains = 0;
-	mNumLeftovers = 0;
-	
-	//TODO::: Check if this should really be here
-	mFirstPass = true;
-
-	mCurrentAbsoluteReadPosition = 0;
-	mApparentReadPosition = 0;
-	//mSourceLocation = "";
-	//mContentLength = -1;
-}
-bool HTTPStreamingFileSource::isError()
-{
-	return mWasError;
-}
-bool HTTPStreamingFileSource::isEOF() {
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		unsigned long locSizeBuffed = mMemoryBuffer->numBytesAvail(); //mFileCache.bytesAvail();;
-	
-		//debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
-		if ((locSizeBuffed == 0) && mIsEOF) {
-			//debugLog<<"isEOF : It is EOF"<<endl;
-			return true;
-		} else {
-			//debugLog<<"isEOF : It's not EOF"<<endl;
-			return false;
-		}
-	} //END CRITICAL SECTION
-
-}
-unsigned long HTTPStreamingFileSource::read(char* outBuffer, unsigned long inNumBytes) {
-	//Reads from the buffer, will return 0 if nothing in buffer.
-	// If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
-
-	unsigned long locNumRead = 0;
-	{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
-		CAutoLock locLock(mBufferLock);
-		
-		if (!mFirstPass && (mApparentReadPosition < mStreamStartBufferLength)) {
-			//In this case we have done a seekback and need to serve the request from the start buffer
-			unsigned long locBytesStillBuffered = mStreamStartBufferLength - mApparentReadPosition;
-
-			unsigned long locBytesToRead = (inNumBytes <= locBytesStillBuffered)	?	inNumBytes
-																					:	locBytesStillBuffered;
-
-			memcpy((void*)outBuffer, (const void*)(mStreamStartBuffer + mApparentReadPosition), locBytesToRead);
-			mApparentReadPosition += locBytesToRead;
-			locNumRead = locBytesToRead;
-
-		} else {
-			//debugLog<<"Read:"<<endl;
-			if((mMemoryBuffer->numBytesAvail() == 0) || mWasError) {
-				//debugLog<<"read : Can't read is error or eof"<<endl;
-				//return 0;
-			} else {
-				//debugLog<<"Reading from buffer"<<endl;
-				
-				//Allow short reads from buffer
-				locNumRead = mMemoryBuffer->read((unsigned char*)outBuffer, inNumBytes, true);
-
-				//Handle the special start of stream buffer
-				if (mFirstPass && (locNumRead > 0) && (mStreamStartBufferLength < STREAM_START_BUFFER_SIZE)) {
-					//If we are still on the first pass (which means we are still parsing header info)
-					//	then we copy this into the start buffer
-
-					unsigned long locSpaceLeftInStartBuffer = STREAM_START_BUFFER_SIZE - mStreamStartBufferLength;
-
-					//There is at least 1 byte of space left
-					unsigned long locBytesToCopy = (locNumRead <= locSpaceLeftInStartBuffer)	?	locNumRead
-																								:	locSpaceLeftInStartBuffer;
-
-					memcpy((void*)(mStreamStartBuffer + mStreamStartBufferLength), (const void*)outBuffer, locBytesToCopy);
-					mStreamStartBufferLength += locBytesToCopy;
-				}
-
-
-				if (locNumRead > 0) {
-					debugLog<<locNumRead<<" bytes read from buffer at "<<mCurrentAbsoluteReadPosition<< endl;
-				}
-
-				mCurrentAbsoluteReadPosition += locNumRead;
-
-				//if (mMemoryBuffer->numBytesAvail() <= MEMORY_BUFFER_LOW_TIDE) {
-				//	CallWorker(THREAD_RUN);
-				//}
-				//return locNumRead;
-
-			}
-		}
-	} //END CRITICAL SECTION
-
-	if ((mMemoryBuffer->numBytesAvail() <= MEMORY_BUFFER_LOW_TIDE) && (!mIsBufferFilling) && (!mIsEOF)) {
-		CallWorker(THREAD_RUN);
-	}
-
-	
-	return locNumRead;
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/HTTPStreamingFileSource.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,125 +0,0 @@
-
-//===========================================================================
-//Copyright (C) 2003-2006 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-
-#include "HTTPSocket.h"
-#include "IFilterDataSource.h"
-#include <string>
-#include <sstream>
-#include <fstream>
-
-using namespace std;
-
-class OGG_DEMUX2_API HTTPStreamingFileSource
-	:	public IFilterDataSource
-	,	public CAMThread
-	,	protected HTTPSocket	
-{
-public:
-	HTTPStreamingFileSource(void);
-	virtual ~HTTPStreamingFileSource(void);
-
-	//Consts
-	static const unsigned long MEMORY_BUFFER_SIZE = 1024 * 1024 * 2;	//2 megs
-	static const unsigned long MEMORY_BUFFER_LOW_TIDE = 1024 * 512 * 3; //1.5 megs
-	//Thread commands
-	static const int THREAD_RUN = 0;
-	static const int THREAD_EXIT = 1;
-
-	//IFilterDataSource Interface
-	virtual unsigned long seek(unsigned long inPos);
-	virtual void close() ;
-	virtual bool open(wstring inSourceLocation, unsigned long inStartByte = 0);
-	virtual void clear();
-	virtual bool isEOF();
-	virtual bool isError();
-	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
-	virtual wstring shouldRetryAt();
-
-	
-	//CAMThread pure virtuals
-	DWORD ThreadProc();
-
-
-
-protected:
-	void unChunk(unsigned char* inBuff, unsigned long inNumBytes);
-	unsigned short getHTTPResponseCode(string inHTTPResponse);
-	bool startThread();
-	void DataProcessLoop();
-
-	//SingleMediaFileCache mFileCache;
-	CircularBuffer* mMemoryBuffer;
-
-	bool mIsChunked;
-	unsigned long mChunkRemains;
-
-	bool mIsBufferFilling;
-
-	bool mIsFirstChunk;
-	wstring mRetryAt;
-
-	fstream debugLog;
-	fstream fileDump;
-	fstream rawDump;
-
-	unsigned char* mInterBuff;
-	unsigned long mNumLeftovers;
-	static	const unsigned long RECV_BUFF_SIZE = 1024;
-	static const unsigned long STREAM_START_BUFFER_SIZE = 32 * 1024;
-
-	//Fix for seekback on headers - since we only maintain a forward buffer. The seek back to start which occurs
-	//	right after the headers are processed, will generally trigger a stream reset. But an annodex server,
-	//	will serve out a file with completely different serial numbers, making it impossible to map the streams
-	//	using the originally gathered information.
-	//
-	//Now we are going to buffer up the first part of the file into yet another buffer. Also keep track
-	//	of what the absolute byte position is we have read up to so far from the stream. When we receive a seek request,
-	//	we check if the current read position is within this new buffer.
-	//
-	//If it is, then we can set a flag, and respond to read requests from this new buffer, up until the point
-	//	where the stream was before the seek, then switch back to serving out live streaming data.
-	unsigned long mCurrentAbsoluteReadPosition;
-	bool mFirstPass;
-
-	unsigned char* mStreamStartBuffer;
-	unsigned long mStreamStartBufferLength;
-
-	unsigned long mApparentReadPosition;
-	
-	//
-
-	__int64 mContentLength;
-
-	CCritSec* mBufferLock;
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ICustomSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ICustomSource.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ICustomSource.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,9 +0,0 @@
-#pragma once
-
-#include "IFilterDataSource.h"
-
-DECLARE_INTERFACE_(ICustomSource, IUnknown)
-{
-public:
-	virtual HRESULT setCustomSourceAndLoad(IFilterDataSource* inDataSource) = 0;
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/IFilterDataSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/IFilterDataSource.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/IFilterDataSource.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,50 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <string>
-using namespace std;
-class IFilterDataSource
-{
-public:
-	//Empty Constructor and destructor to ensure proper deletion
-	IFilterDataSource(void)							{}
-	virtual ~IFilterDataSource(void)				{}
-
-	virtual unsigned long seek(unsigned long inPos) = 0;
-	virtual void close()  = 0;
-	virtual bool open(wstring inSourceLocation, unsigned long inStartByte = 0) = 0;
-	virtual void clear() = 0;
-	virtual bool isEOF() = 0;
-	virtual bool isError() = 0;
-	virtual unsigned long read(char* outBuffer, unsigned long inNumBytes) = 0;
-	virtual wstring shouldRetryAt() = 0;
-	
-};

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.cpp (from rev 17148, trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.cpp	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,813 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//Copyright (C) 2009, 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "OggDemuxFilter.h"
+#include "OggDemuxOutputPin.h"
+#include "OggStreamMapper.h"
+#include <InitGuid.h>
+#include "ds_guids.h"
+#include "common/util.h"
+
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] = 
+{
+    { 
+        OggDemuxFilter::NAME,			// Name
+	    &CLSID_OggDemuxFilter,          // CLSID
+	    OggDemuxFilter::CreateInstance,	// Method to create an instance of MyComponent
+        NULL,							// Initialization function
+        &OggDemuxFilter::m_filterReg    // Set-up information (for filters)
+    }
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 
+
+const wchar_t* OggDemuxFilter::NAME = L"Xiph.Org Ogg Demuxer";
+
+const AMOVIESETUP_PIN OggDemuxFilter::m_pinReg[] = 
+{	
+    {
+        L"Ogg Input",                       //Name (obsoleted)
+        FALSE,                              //Renders from this pin ?? Not sure about this.
+        FALSE,                              //Is an output pin
+        FALSE,                              //Can have zero instances of this pin
+        FALSE,                              //Can have more than one instance of this pin
+        &CLSID_NULL,                        //Connects to filter (obsoleted)
+        NULL,                               //Connects to pin (obsoleted)
+        1,                                  //Only support one media type
+        &m_inputMediaTypes                  //Pointer to media type (Audio/Vorbis or Audio/Speex)
+    } ,
+    {
+        L"Ogg Packet Out",					//Name (obsoleted)
+        FALSE,								//Renders from this pin ?? Not sure about this.
+        TRUE,								//Is an output pin
+        TRUE,								//Can have zero instances of this pin
+        TRUE,								//Can have more than one instance of this pin
+        &GUID_NULL,							//Connects to filter (obsoleted)
+        NULL,								//Connects to pin (obsoleted)
+        1,									//Only support one media type
+        &m_outputMediaTypes	                //Pointer to media type (Audio/Vorbis or Audio/Speex)	
+    }
+};
+
+const AMOVIESETUP_FILTER OggDemuxFilter::m_filterReg = 
+{
+    &CLSID_OggDemuxFilter,              // Filter CLSID.
+    NAME,                               // Filter name.
+    MERIT_NORMAL,                       // Merit.
+    2,                                  // Number of pin types.
+    m_pinReg                            // Pointer to pin information.
+};
+
+const AMOVIESETUP_MEDIATYPE OggDemuxFilter::m_outputMediaTypes = 
+{
+    &MEDIATYPE_OggPacketStream,
+    &MEDIASUBTYPE_None
+};
+
+const AMOVIESETUP_MEDIATYPE OggDemuxFilter::m_inputMediaTypes =
+{ 
+    &MEDIATYPE_Stream,
+    &MEDIASUBTYPE_NULL 
+}; 
+
+namespace {
+    const int BUFFER_LENGTH = 4096;
+}
+
+#ifdef WINCE
+LPAMOVIESETUP_FILTER OggDemuxFilter::GetSetupData()
+{	
+	return (LPAMOVIESETUP_FILTER)&m_pinReg;	
+}
+#endif
+
+//COM Creator Function
+CUnknown* WINAPI OggDemuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
+{
+    util::ConfigureLogSettings();
+
+    OggDemuxFilter *pNewObject = new (std::nothrow) OggDemuxFilter(pHr);
+    if (pNewObject == NULL) 
+    {
+        *pHr = E_OUTOFMEMORY;
+    }
+    return pNewObject;
+} 
+
+OggDemuxFilter::OggDemuxFilter(HRESULT* outHR) :	
+CBaseFilter(NAME, NULL, &m_filterLock, CLSID_OggDemuxFilter),
+m_seenAllBOSPages(false),
+m_seenPositiveGranulePos(false),
+m_pendingPage(NULL),
+m_justReset(true),
+m_seekTable(NULL),
+m_globalBaseTime(0),
+m_usingCustomSource(false),
+m_inputPin(this, m_pLock, outHR),
+m_currentReaderPos(0),
+m_requestedSeekPos(0)
+{
+	LOG(logDEBUG) << L"Creating OggDemuxFilter object";
+
+	m_streamMapper = new OggStreamMapper(this, m_pLock);
+}
+
+OggDemuxFilter::~OggDemuxFilter()
+{
+	LOG(logDEBUG) << L"Destroying OggDemuxFilter";
+
+    delete m_streamMapper;
+	delete m_seekTable;
+}
+
+STDMETHODIMP OggDemuxFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+    LOG(logDEBUG4) << L"NonDelegatingQueryInterface: " << riid;
+
+    if (riid == IID_IOggBaseTime) 
+    {
+        return GetInterface((IOggBaseTime*)this, ppv);
+    }
+
+    return CBaseFilter::NonDelegatingQueryInterface(riid, ppv); 
+}
+
+//IMEdiaStreaming
+STDMETHODIMP OggDemuxFilter::Run(REFERENCE_TIME tStart) 
+{
+	CAutoLock locLock(m_pLock);
+    LOG(logDEBUG) << "Run: " << ReferenceTime(tStart);
+	
+    return CBaseFilter::Run(tStart);
+}
+
+STDMETHODIMP OggDemuxFilter::Pause() 
+{
+	CAutoLock locLock(m_pLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+
+	if (m_State == State_Stopped) 
+    {
+        LOG(logDEBUG) <<L"Pause -- was stopped";
+
+		if (ThreadExists() == FALSE) 
+        {
+            LOG(logDEBUG) << L"Pause -- CREATING THREAD";
+			Create();
+		}
+
+        LOG(logDEBUG) << L"Pause -- RUNNING THREAD";
+		CallWorker(THREAD_RUN);
+	}
+
+	HRESULT hr = CBaseFilter::Pause();
+
+    LOG(logDEBUG) << __FUNCTIONW__ << L"Base class returned: 0x" << std::hex << hr;
+	
+	return hr;	
+}
+
+STDMETHODIMP OggDemuxFilter::Stop(void) 
+{
+	CAutoLock locLock(m_pLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+
+	CallWorker(THREAD_EXIT);
+	Close();
+	DeliverBeginFlush();
+	//mSetIgnorePackets = true;
+	DeliverEndFlush();
+	
+	return CBaseFilter::Stop();
+}
+
+void OggDemuxFilter::DeliverBeginFlush() 
+{
+	CAutoLock locLock(m_pLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+	
+	for (unsigned long i = 0; i < m_streamMapper->numPins(); i++) 
+    {
+		m_streamMapper->getPinByIndex(i)->DeliverBeginFlush();
+	}
+
+	//Should this be here or endflush or neither ?
+	resetStream();
+}
+
+void OggDemuxFilter::DeliverEndFlush() 
+{
+	CAutoLock locLock(m_pLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+
+	for (unsigned long i = 0; i < m_streamMapper->numPins(); i++) 
+    {
+		//m_streamMapper->getOggStream(i)->flush();
+		m_streamMapper->getPinByIndex(i)->DeliverEndFlush();
+	}
+}
+
+void OggDemuxFilter::DeliverEOS() 
+{
+	//m_streamMapper->toStartOfData();
+    CAutoLock locStreamLock(&m_streamLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+	
+    for (unsigned long i = 0; i < m_streamMapper->numPins(); i++) 
+    {
+		//m_streamMapper->getOggStream(i)->flush();
+		m_streamMapper->getPinByIndex(i)->DeliverEndOfStream();
+	}
+
+    resetStream();
+}
+
+void OggDemuxFilter::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) 
+{
+    CAutoLock locStreamLock(&m_streamLock);
+	LOG(logDEBUG) << __FUNCTIONW__;
+	
+    for (unsigned long i = 0; i < m_streamMapper->numPins(); i++) 
+    {
+		m_streamMapper->getPinByIndex(i)->DeliverNewSegment(tStart, tStop, dRate);
+	}
+}
+
+void OggDemuxFilter::resetStream() 
+{
+	CAutoLock locDemuxLock(&m_demuxLock);
+    LOG(logDEBUG) << __FUNCTIONW__;
+
+	m_oggBuffer.clearData();
+	
+	m_justReset = true;   //TODO::: Look into this !
+}
+
+bool OggDemuxFilter::acceptOggPage(OggPage* inOggPage)
+{
+	if (!m_seenAllBOSPages) 
+    {
+		if (!inOggPage->header()->isBOS()) 
+        {
+			m_seenAllBOSPages = true;
+			m_bufferedPages.push_back(inOggPage);
+			return true;
+		} 
+        else 
+        {
+            LOG(logDEBUG) << __FUNCTIONW__ << " Found BOS\r\n" << inOggPage->header()->toString().c_str();
+			return m_streamMapper->acceptOggPage(inOggPage);
+		}
+	} 
+    else if (!m_seenPositiveGranulePos) 
+    {
+		if (inOggPage->header()->GranulePos() > 0) 
+        {
+			m_seenPositiveGranulePos = true;
+		}
+		
+        m_bufferedPages.push_back(inOggPage);
+		return true;
+	} 
+    else 
+    {
+		//OGGCHAIN::: Here, need to check for an eos, and reset stream, else do it in strmapper
+		return m_streamMapper->acceptOggPage(inOggPage);
+	}
+}
+
+HRESULT OggDemuxFilter::SetUpPins()
+{
+	CAutoLock locDemuxLock(&m_demuxLock);
+	
+	LOG(logDEBUG) << __FUNCTIONW__;
+	
+	//Register a callback
+	m_oggBuffer.registerVirtualCallback(this);
+
+    std::auto_ptr<BYTE> buffer(new BYTE[SETUP_BUFFER_SIZE]);
+    LONGLONG position = 0;
+    HRESULT hr = S_OK;
+
+    CComPtr<IAsyncReader> reader = m_inputPin.GetReader();
+
+    //Feed the data in until we have seen all BOS pages.
+    while (SUCCEEDED(hr) && !m_seenPositiveGranulePos) 
+    {
+        hr = reader->SyncRead(position, SETUP_BUFFER_SIZE, buffer.get());
+        if (hr == S_OK) 
+        {
+            m_oggBuffer.feed(buffer.get(), SETUP_BUFFER_SIZE);
+            position += SETUP_BUFFER_SIZE;
+        } 
+        else if (!(hr == S_FALSE && m_seenPositiveGranulePos)) 
+        {
+            //This prevents us dying on small files, if we hit eof but we also saw a +'ve gran pos, this file is ok.
+            LOG(logERROR) << __FUNCTIONW__ << " Bailing out";
+            hr = VFW_E_CANNOT_RENDER;
+        }
+    }
+
+    m_oggBuffer.clearData();
+	LOG(logDEBUG) << "COMPLETED SETUP";
+	
+    return S_OK;
+}
+
+std::vector<OggPage*> OggDemuxFilter::getMatchingBufferedPages(unsigned long inSerialNo)
+{
+    std::vector<OggPage*> locList;
+	for (size_t i = 0; i < m_bufferedPages.size(); i++) 
+    {
+		if (m_bufferedPages[i]->header()->StreamSerialNo() == inSerialNo) 
+        {
+			locList.push_back(m_bufferedPages[i]->clone());
+		}
+	}
+	
+    return locList;
+}
+
+void OggDemuxFilter::removeMatchingBufferedPages(unsigned long inSerialNo)
+{
+    std::vector<OggPage*> locNewList;
+	int locSize = m_bufferedPages.size();
+	
+    for (int i = 0; i < locSize; i++) 
+    {
+		if (m_bufferedPages[i]->header()->StreamSerialNo() != inSerialNo) 
+        {
+			locNewList.push_back(m_bufferedPages[i]);
+		} 
+        else 
+        {
+			delete m_bufferedPages[i];
+		}
+	}
+
+	m_bufferedPages = locNewList;
+}
+
+int OggDemuxFilter::GetPinCount() 
+{
+	return m_streamMapper->numPins() + 1;
+}
+
+CBasePin* OggDemuxFilter::GetPin(int inPinNo) 
+{
+	if (inPinNo < 0) 
+    {
+		return NULL;
+	}
+    else if (inPinNo == 0)
+    {
+        return &m_inputPin;
+    }
+
+	return m_streamMapper->getPinByIndex(inPinNo - 1);
+}
+
+//CAMThread Stuff
+DWORD OggDemuxFilter::ThreadProc() 
+{	
+	while(true) 
+    {
+		DWORD locThreadCommand = GetRequest();
+	
+		switch(locThreadCommand) 
+        {
+			case THREAD_EXIT:
+	
+				Reply(S_OK);
+                LOG(logDEBUG) << __FUNCTIONW__ << " THREAD IS EXITING";
+				return S_OK;
+
+			case THREAD_RUN:
+	
+				Reply(S_OK);
+				DataProcessLoop();
+                LOG(logDEBUG) << __FUNCTIONW__ << " Data Process Loop has returned";
+				break;
+
+           case THREAD_SEEK:
+
+               m_oggBuffer.clearData();
+               SetCurrentReaderPos(GetRequestedSeekPos());
+               Reply(S_OK);
+
+               DataProcessLoop();
+               LOG(logDEBUG) << __FUNCTIONW__ << " Seek request";
+               break;
+		}
+	}
+
+	return S_OK;
+}
+
+void OggDemuxFilter::notifyPinConnected()
+{
+    LOG(logDEBUG) << __FUNCTIONW__;
+
+    if (!m_streamMapper->allStreamsReady()) 
+    {
+        return;
+    }
+
+    if (m_seekTable) 
+    {
+        return;
+    }
+
+    m_seekTable = new CustomOggChainGranuleSeekTable();
+    int outputPinCount = GetPinCount();
+
+    for (int i = 1; i < outputPinCount; i++) 
+    {
+        OggDemuxOutputPin* pin = static_cast<OggDemuxOutputPin*>(GetPin(i));
+
+        LOG(logDEBUG) << L"Adding decoder interface to seek table, serial no: " << pin->getSerialNo();
+        m_seekTable->addStream(pin->getSerialNo(), pin->getDecoderInterface());
+    }
+
+#ifndef WINCE
+    LOG(logDEBUG) << __FUNCTIONW__ << L" Building seek table...";
+
+    CComPtr<IAsyncReader> reader = m_inputPin.GetReader();
+    static_cast<CustomOggChainGranuleSeekTable*>(m_seekTable)->buildTable(reader);
+
+    LOG(logDEBUG) << __FUNCTIONW__ << L" Built.";
+#endif
+}
+
+HRESULT OggDemuxFilter::DataProcessLoop() 
+{
+	//Mess with the locking mechanisms at your own risk.
+	DWORD threadCommand = 0;
+    std::auto_ptr<BYTE> buffer(new  BYTE[BUFFER_LENGTH]);
+
+    unsigned long bytesRead = 0;
+	bool isEOF = false;
+
+	OggDataBuffer::eFeedResult feedResult;
+
+	bool continueLooping = true;
+	while (continueLooping) 
+    {
+		if (CheckRequest(&threadCommand) == TRUE) 
+        {
+		    LOG(logDEBUG) << __FUNCTIONW__ << " ThreadProc command encountered (" << threadCommand << ") Exiting.";
+		    return S_OK;
+		}
+
+        if (m_inputPin.Read(GetCurrentReaderPos(), BUFFER_LENGTH, buffer.get()) == S_FALSE)
+        {
+            isEOF = true;
+            bytesRead = static_cast<unsigned long>(m_inputPin.Length() % BUFFER_LENGTH);
+        }
+        else
+        {
+            bytesRead = BUFFER_LENGTH;
+        }
+        SetCurrentReaderPos(GetCurrentReaderPos() + bytesRead);
+
+		m_justReset = false;
+
+		try
+		{
+			CAutoLock locDemuxLock(&m_demuxLock);
+			//CAutoLock locStreamLock(m_streamLock);
+            //To avoid blocking problems... restart the loop if it was just reset while waiting for lock.
+			if (m_justReset) 
+            {		
+                LOG(logDEBUG) << __FUNCTIONW__ << " Detected JustRest condition";
+				continue;
+			}
+			feedResult = m_oggBuffer.feed(buffer.get(), bytesRead);
+
+            LOG(logDEBUG) << __FUNCTIONW__ << " Feed result = " << feedResult 
+                << " BytesRead: " << bytesRead << " CurrentReadPos: " << GetCurrentReaderPos();
+
+            if (!(feedResult == OggDataBuffer::FEED_OK || 
+                  feedResult == OggDataBuffer::PROCESS_DISPATCH_FALSE))
+			{
+				break;
+			}
+		}
+		catch (int)
+		{
+            LOG(logDEBUG) << __FUNCTIONW__ << " Caught an exception.";
+
+			isEOF = true;
+			continueLooping = false;
+		}
+
+		if (isEOF) 
+        {
+			//debugLog << "DataProcessLoop : EOF"<<endl;
+            CAutoLock locStreamLock(&m_streamLock);
+			LOG(logDEBUG) << __FUNCTIONW__ << " EOF Deliver EOS";
+			DeliverEOS();
+		}
+	}
+
+	LOG(logDEBUG) << __FUNCTIONW__ << " Exiting.";
+
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetCapabilities(DWORD* inCapabilities) 
+{
+	if (m_seekTable == NULL || !m_seekTable->enabled())  
+    {
+        *inCapabilities = 0;
+        return S_OK;;
+    }
+
+	*inCapabilities = mSeekingCap;
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetDuration(LONGLONG* pDuration) 
+{
+	if (m_seekTable == NULL || !m_seekTable->enabled()) 
+    {
+        return E_NOTIMPL;
+    }
+
+	*pDuration = m_seekTable->fileDuration();
+
+    LOG(logDEBUG4) << "IMediaSeeking::GetDuration(" << ReferenceTime(*pDuration) << ") -> 0x" << std::hex << S_OK;
+
+    return S_OK;
+}
+	 
+STDMETHODIMP OggDemuxFilter::CheckCapabilities(DWORD *pCapabilities)
+{
+    HRESULT result = S_OK;
+
+    DWORD dwActual;
+    GetCapabilities(&dwActual);
+    if (*pCapabilities & (~dwActual))
+    {
+        result = S_FALSE;
+    }
+
+    LOG(logDEBUG3) << "IMediaSeeking::CheckCapabilities(" << *pCapabilities << ") -> 0x" << std::hex << result;
+
+    return result;
+}
+
+STDMETHODIMP OggDemuxFilter::IsFormatSupported(const GUID *pFormat)
+{
+    HRESULT result = S_FALSE;
+
+    if (*pFormat == TIME_FORMAT_MEDIA_TIME) 
+    {
+        result = S_OK;
+    } 
+
+    LOG(logDEBUG4) << "IMediaSeeking::IsFormatSupported(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
+
+    return result;
+}
+
+STDMETHODIMP OggDemuxFilter::QueryPreferredFormat(GUID *pFormat)
+{
+	*pFormat = TIME_FORMAT_MEDIA_TIME;
+
+    LOG(logDEBUG3) << "IMediaSeeking::QueryPreferredFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK; 
+
+	return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::SetTimeFormat(const GUID *pFormat)
+{
+    LOG(logDEBUG3) << "IMediaSeeking::SetTimeFormat(" << ToString(pFormat) << ") -> 0x" << std::hex << E_NOTIMPL; 
+	
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP OggDemuxFilter::GetTimeFormat( GUID *pFormat)
+{
+	*pFormat = TIME_FORMAT_MEDIA_TIME;
+
+    LOG(logDEBUG3) << "IMediaSeeking::GetTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK; 
+
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetStopPosition(LONGLONG *pStop)
+{
+	if (m_seekTable == NULL || !m_seekTable->enabled())  
+    {
+        return E_NOTIMPL;
+    }
+
+    *pStop = m_seekTable->fileDuration();
+
+    LOG(logDEBUG3) << "IMediaSeeking::GetStopPosition(" << ReferenceTime(*pStop) << ") -> 0x" << std::hex << S_OK;
+
+	return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetCurrentPosition(LONGLONG *pCurrent)
+{
+	return E_NOTIMPL;
+}
+
+STDMETHODIMP OggDemuxFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
+{
+    LOG(logDEBUG3) << "IMediaSeeking::ConvertTimeFormat(" << ToString(pTarget) 
+        << ", " << ToString(pTargetFormat) << ", " << ToString(Source)
+        << ", " << ToString(pSourceFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
+
+    return E_NOTIMPL;
+}
+
+STDMETHODIMP OggDemuxFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags)
+{
+    CAutoLock locLock(m_pLock);
+
+    LOG(logDEBUG3) << "IMediaSeeking::SetPositions(" << ReferenceTime(*pCurrent) << ", " << dwCurrentFlags
+        << ", " << ReferenceTime(*pStop) << ", " << dwStopFlags << ") -> 0x" << std::hex << S_OK;
+
+    if (m_seekTable == NULL || !m_seekTable->enabled())  
+    {
+        return E_NOTIMPL;
+    }
+	
+	DeliverBeginFlush();
+	
+	//Find the byte position for this time.
+	if (*pCurrent > m_seekTable->fileDuration()) 
+    {
+		*pCurrent = m_seekTable->fileDuration();
+	} 
+    else if (*pCurrent < 0) 
+    {
+		*pCurrent = 0;
+	}
+
+	OggGranuleSeekTable::tSeekPair locStartPos = m_seekTable->seekPos(*pCurrent);
+		
+	//For now, seek to the position directly, later we will discard the preroll
+	//Probably don't ever want to do this. We want to record the desired time,
+	//	and it will be up to the decoders to drop anything that falls before it.
+	
+    DeliverEndFlush();
+	DeliverNewSegment(*pCurrent, m_seekTable->fileDuration(), 1.0);
+
+	// Second is the file position.
+    SetRequestedSeekPos(locStartPos.second.first);
+    if (CallWorker(THREAD_SEEK) == E_FAIL)
+    {
+        // Thread not running, we're changing the current position ourselfs
+        SetCurrentReaderPos(GetRequestedSeekPos());
+    }
+
+	return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop)
+{
+	return E_NOTIMPL;
+}
+
+STDMETHODIMP OggDemuxFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest)
+{
+    if (m_seekTable == NULL || !m_seekTable->enabled())  
+    {
+        return E_NOTIMPL;
+    }
+
+    *pEarliest = 0;
+    *pLatest = m_seekTable->fileDuration();
+
+    LOG(logDEBUG3) << "IMediaSeeking::GetAvailable(" << ToString(*pEarliest) << ", " << ToString(*pLatest)
+                   << ") -> 0x" << std::hex << S_OK;
+
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::SetRate(double dRate)
+{
+    HRESULT result = VFW_E_UNSUPPORTED_AUDIO;
+
+    if (dRate == 1.00f)
+    {
+        result = S_OK;
+    }
+    else if (dRate <= 0.00f)
+    {
+        result = E_INVALIDARG;
+    }
+
+    LOG(logDEBUG3) << "IMediaSeeking::SetRate(" << std::setprecision(3) << std::showpoint
+                   << dRate << ") -> 0x" << std::hex << result;
+
+    return result;
+}
+
+STDMETHODIMP OggDemuxFilter::GetRate(double *dRate)
+{
+    *dRate = 1.0;
+
+    LOG(logDEBUG3) << "IMediaSeeking::GetRate(" << std::setprecision(3) << std::showpoint
+                   << *dRate << ") -> 0x" << std::hex << S_OK;
+
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::GetPreroll(LONGLONG *pllPreroll)
+{
+    *pllPreroll = 0;
+
+    LOG(logDEBUG3) << "IMediaSeeking::GetPreroll(" << ToString(*pllPreroll) << ") -> 0x" << std::hex << S_OK;
+
+    return S_OK;
+}
+
+STDMETHODIMP OggDemuxFilter::IsUsingTimeFormat(const GUID *pFormat) 
+{
+    HRESULT result = S_FALSE;
+
+    if (*pFormat == TIME_FORMAT_MEDIA_TIME) 
+    {
+        result = S_OK;
+    }
+
+    LOG(logDEBUG4) << "IMediaSeeking::IsUsingTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
+
+    return result;
+}
+
+bool OggDemuxFilter::notifyStreamBaseTime(__int64 inStreamBaseTime)
+{
+	if (inStreamBaseTime > m_globalBaseTime) 
+    {
+		m_globalBaseTime = inStreamBaseTime;
+	}
+	
+    return true;
+}
+
+__int64 OggDemuxFilter::getGlobalBaseTime()
+{
+	return m_globalBaseTime;
+}
+
+CCritSec* OggDemuxFilter::streamLock()
+{
+    return &m_streamLock;
+}
+
+void OggDemuxFilter::SetCurrentReaderPos(LONGLONG val)
+{
+    m_currentReaderPos = val;
+}
+
+LONGLONG OggDemuxFilter::GetCurrentReaderPos() const
+{
+    return m_currentReaderPos;
+}
+
+LONGLONG OggDemuxFilter::GetRequestedSeekPos() const
+{
+    return m_requestedSeekPos;
+}
+
+void OggDemuxFilter::SetRequestedSeekPos(LONGLONG val)
+{
+    m_requestedSeekPos = val;
+}

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.h (from rev 17148, trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.h	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxFilter.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,171 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//Copyright (C) 2009, 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "BasicSeekPassThrough.h"
+#include "IOggBaseTime.h"
+#include <libOOOgg/OggDataBuffer.h>
+
+#include <libOOOggSeek/AutoOggChainGranuleSeekTable.h>
+#include "CustomOggChainGranuleSeekTable.h"
+#include "OggDemuxInputPin.h"
+
+class OggStreamMapper;
+class OggDemuxFilter:	
+    public CBaseFilter,	
+    public CAMThread,	
+    public IOggCallback,	
+    public IOggBaseTime,	
+    public BasicSeekPassThrough
+{
+public:
+    OggDemuxFilter(HRESULT* outHR);
+	virtual ~OggDemuxFilter();
+
+    enum eThreadCommands 
+    {
+		THREAD_EXIT = 0,
+		THREAD_PAUSE = 1,
+		THREAD_RUN = 2,
+        THREAD_SEEK = 3
+	};
+
+	//Com Stuff
+	DECLARE_IUNKNOWN
+
+    static const wchar_t* NAME;
+    static const AMOVIESETUP_MEDIATYPE m_outputMediaTypes;
+    static const AMOVIESETUP_MEDIATYPE m_inputMediaTypes;
+    static const AMOVIESETUP_PIN m_pinReg[];
+    static const AMOVIESETUP_FILTER m_filterReg;
+
+	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+	static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+	//Streaming MEthods
+	STDMETHODIMP Run(REFERENCE_TIME tStart);
+	STDMETHODIMP Pause();
+	STDMETHODIMP Stop();
+
+#ifdef WINCE
+	virtual LPAMOVIESETUP_FILTER GetSetupData();
+#endif
+
+	//IOggCallback Interface
+	virtual bool acceptOggPage(OggPage* inOggPage);
+
+	//PURE VIRTUALS From CBaseFilter
+	virtual int GetPinCount();
+	virtual CBasePin* GetPin(int inPinNo);
+
+	//PURE VIRTUALS from CAMThread
+	virtual DWORD ThreadProc();
+
+	//IMediaSeeking
+	virtual STDMETHODIMP GetDuration(LONGLONG* outDuration);
+	virtual STDMETHODIMP GetCapabilities(DWORD* inCapabilities);
+	 
+	virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
+	virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
+	virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
+	virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
+	virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
+	
+	virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
+	virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+	virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
+	virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
+	virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+	virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
+	virtual STDMETHODIMP SetRate(double dRate);
+	virtual STDMETHODIMP GetRate(double *dRate);
+	virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
+	virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
+
+    std::vector<OggPage*> getMatchingBufferedPages(unsigned long inSerialNo);
+	void removeMatchingBufferedPages(unsigned long inSerialNo);
+
+	CCritSec* streamLock();
+
+	virtual void notifyPinConnected();
+	virtual bool notifyStreamBaseTime(__int64 inStreamBaseTime);
+
+	//IOggBaseTime Interface
+	virtual __int64 getGlobalBaseTime();
+
+    LONGLONG GetCurrentReaderPos() const;
+    void SetCurrentReaderPos(LONGLONG val);
+
+    LONGLONG GetRequestedSeekPos() const;
+    void SetRequestedSeekPos(LONGLONG val);
+
+
+protected:
+    friend class OggDemuxInputPin;
+    friend class OggDemuxOutputPin;
+
+	static const unsigned long SETUP_BUFFER_SIZE = 24;
+	virtual HRESULT SetUpPins();
+
+	void resetStream();
+	HRESULT DataProcessLoop();
+
+	void DeliverEOS();
+	void DeliverBeginFlush();
+	void DeliverEndFlush();
+	void DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+	CCritSec m_filterLock;
+	CCritSec m_demuxLock;
+	CCritSec m_streamLock;
+    CCritSec m_positionLock;
+
+	wstring m_fileName;
+
+	bool m_seenAllBOSPages;
+	bool m_seenPositiveGranulePos;
+	OggPage* m_pendingPage;
+    std::vector<OggPage*> m_bufferedPages;
+
+	OggDataBuffer m_oggBuffer;
+	OggStreamMapper* m_streamMapper;
+
+    OggDemuxInputPin m_inputPin;
+
+	AutoOggChainGranuleSeekTable* m_seekTable;
+
+	bool m_usingCustomSource;
+	bool m_justReset;
+	LONGLONG m_globalBaseTime;
+
+    LONGLONG m_currentReaderPos; 
+    LONGLONG m_requestedSeekPos;
+};

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.cpp	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,158 @@
+//===========================================================================
+//Copyright (C) 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Cristian Adam nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "OggDemuxInputPin.h"
+#include "OggDemuxFilter.h"
+#include "ds_guids.h"
+
+OggDemuxInputPin::OggDemuxInputPin(OggDemuxFilter* pFilter, CCritSec* pLock, HRESULT* phr)
+: m_filter(pFilter), 
+CBasePin(NAME("OggDemuxInputPin"), pFilter, pLock, phr, L"Input", PINDIR_INPUT)
+{
+    m_mediaType.SetType(&MEDIATYPE_Stream);
+    m_mediaType.SetSubtype(&MEDIASUBTYPE_Ogg);
+}
+
+// base pin overrides
+HRESULT OggDemuxInputPin::CheckMediaType(const CMediaType* inMediaType)
+{
+    CheckPointer(inMediaType, E_POINTER);
+    if (m_mediaType.MatchesPartial(inMediaType))
+    {
+        return S_OK;
+    }
+    return S_FALSE;
+}
+
+HRESULT OggDemuxInputPin::GetMediaType(int iPosition, CMediaType* outMediaType)
+{
+	CheckPointer(outMediaType, E_POINTER);
+    if (iPosition != 0)
+    {
+        return VFW_S_NO_MORE_ITEMS;
+    }
+    *outMediaType = m_mediaType;
+
+    return S_OK;
+}
+
+HRESULT OggDemuxInputPin::BeginFlush()
+{
+    m_filter->DeliverBeginFlush();
+    return S_OK;
+}
+
+HRESULT OggDemuxInputPin::EndFlush()
+{
+    m_filter->DeliverEndFlush();
+    return S_OK;
+}
+
+HRESULT OggDemuxInputPin::CompleteConnect(IPin* pPeer)
+{
+    HRESULT hr = CBasePin::CompleteConnect(pPeer);
+
+    if (SUCCEEDED(hr))
+    {
+        hr = m_filter->SetUpPins();
+    }
+    return hr;
+}
+
+HRESULT OggDemuxInputPin::CheckConnect(IPin* pPin)
+{
+    CheckPointer(pPin, E_POINTER);
+
+    // Base implementation verifies pin direction.
+    HRESULT hr = CBasePin::CheckConnect(pPin);
+
+    // Verify "OggS" magic bytes
+    CComQIPtr<IAsyncReader> reader = pPin;
+    if (!reader)
+    {
+        hr = VFW_E_NO_TRANSPORT;
+    }
+
+    BYTE magic[4];
+    if (SUCCEEDED(hr))
+    {
+        hr = reader->SyncRead(0, 4, magic);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+        if (magic[0] != 'O' ||
+            magic[1] != 'g' ||
+            magic[2] != 'g' ||
+            magic[3] != 'S')
+        {
+            hr = VFW_E_UNSUPPORTED_STREAM;
+        }
+    }
+
+    return hr;
+}
+
+HRESULT OggDemuxInputPin::BreakConnect()
+{
+    return CBasePin::BreakConnect();
+}
+
+HRESULT OggDemuxInputPin::Read(LONGLONG llOffset, long cBytes, BYTE* pBuffer)
+{
+    HRESULT hr = E_NOINTERFACE;
+    
+    CComQIPtr<IAsyncReader> reader = GetConnected();
+    if (reader)
+    {
+        hr = reader->SyncRead(llOffset, cBytes, pBuffer);
+    }
+    return hr;
+}
+
+LONGLONG OggDemuxInputPin::Length()
+{
+    LONGLONG llTotal = 0;
+    LONGLONG llAvail;
+    
+    CComQIPtr<IAsyncReader> reader = GetConnected();
+    if (reader)
+    {
+        HRESULT hr = reader->Length(&llTotal, &llAvail);
+    }
+
+    return llTotal;
+}
+
+CComQIPtr<IAsyncReader> OggDemuxInputPin::GetReader()
+{
+    return GetConnected();
+}

Added: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.h	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxInputPin.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,63 @@
+//===========================================================================
+//Copyright (C) 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Cristian Adam nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+class OggDemuxFilter;
+
+// Since we are not using IMemInputPin, it does not make sense to derive from 
+// CBaseInputPin. We need random access to the data, so we do not use CPullPin.
+// A worker thread on the filter calls a Read method to synchronously fetch data
+// from the source.
+class OggDemuxInputPin : public CBasePin
+{
+public:
+    OggDemuxInputPin(OggDemuxFilter* pFilter, CCritSec* pLock, HRESULT* phr);
+
+    // base pin overrides
+    HRESULT CheckMediaType(const CMediaType* pmt);
+    HRESULT GetMediaType(int iPosition, CMediaType* pmt);
+    HRESULT CompleteConnect(IPin* pPeer);
+    HRESULT CheckConnect(IPin* pPin);
+    HRESULT BreakConnect();
+    
+    HRESULT __stdcall BeginFlush();
+    HRESULT __stdcall EndFlush();
+
+    HRESULT Read(LONGLONG llOffset, long cBytes, BYTE* pBuffer);
+    LONGLONG Length();
+
+    CComQIPtr<IAsyncReader> GetReader();
+
+private:
+    OggDemuxFilter* m_filter;
+    CMediaType m_mediaType;
+};
+

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.cpp (from rev 17148, trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.cpp	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,398 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//Copyright (C) 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "ds_guids.h"
+#include "OggDemuxFilter.h"
+#include "OggDemuxOutputPin.h"
+#include "common/Log.h"
+
+OggDemuxOutputPin::	OggDemuxOutputPin(TCHAR* inObjectName, OggDemuxFilter* inParentFilter, CCritSec* inFilterLock,	
+                                      OggPacket* inIdentHeader,	unsigned long inSerialNo):	
+CBaseOutputPin(NAME("Ogg Demux Output Pin"), inParentFilter, inFilterLock, &mFilterHR, L"Ogg Stream"),	
+m_identHeader(inIdentHeader),	
+m_serialNo(inSerialNo),	
+m_isStreamReady(false),	
+m_acceptingData(false),	
+m_numBuffers(0),
+m_dataQueue(NULL),
+mFilterHR(S_OK)
+{
+	m_packetiserLock = new CCritSec;
+	
+	//(BYTE*)inBOSPage->createRawPageData();
+	m_packetiser.setPacketSink(this);
+
+	//Subvert COM and do this directly... this way, the source filter won't expose the interface to the
+	// graph but we can still delegate to it.
+	IMediaSeeking* locSeeker = (IMediaSeeking*)inParentFilter;
+	SetDelegate(locSeeker);
+}
+
+STDMETHODIMP OggDemuxOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+	if (riid == IID_IMediaSeeking) 
+    {
+        return GetInterface((IMediaSeeking*)this, ppv);
+	} 
+    else if (riid == IID_IOggOutputPin) 
+    {
+		*ppv = (IOggOutputPin*)this;
+		//((IUnknown*)*ppv)->AddRef();
+		return NOERROR;		
+	}
+
+	return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 
+}
+
+OggDemuxOutputPin::~OggDemuxOutputPin()
+{
+	//Since we didn't addref the filter when we set the seek delegate onto it, we have to avoid
+	//	it getting released, so set it to NULL, to avoid the destructor releasing it.
+	SetDelegate(NULL);
+	//delete[] mBOSAsFormatBlock;
+	//delete mBOSPage;
+	delete m_identHeader;
+	delete m_dataQueue;
+
+	delete m_packetiserLock;
+}
+
+bool OggDemuxOutputPin::acceptOggPage(OggPage* inOggPage)
+{
+	CAutoLock locPackLock(m_packetiserLock);
+	if (m_isStreamReady) 
+    {
+		m_acceptingData = true;
+		return m_packetiser.acceptOggPage(inOggPage);
+	} 
+    else 
+    {
+		delete inOggPage;
+	}
+	
+    return false;
+}
+
+BYTE* OggDemuxOutputPin::getIdentAsFormatBlock()
+{
+	return (BYTE*)m_identHeader->packetData();
+}
+
+unsigned long OggDemuxOutputPin::getIdentSize()
+{
+	return m_identHeader->packetSize();
+}
+
+unsigned long OggDemuxOutputPin::getSerialNo()
+{
+	return m_serialNo;//mBOSPage->header()->StreamSerialNo();
+}
+
+CComPtr<IOggDecoder> OggDemuxOutputPin::getDecoderInterface()
+{
+    if (!m_decoderInterface) 
+    {
+        if (IsConnected()) 
+        {   
+            IPin* locPin = GetConnected();
+            if (locPin != NULL) 
+            {
+                locPin->QueryInterface(IID_IOggDecoder, (void**)&m_decoderInterface);
+            }
+        }
+    }
+    return m_decoderInterface;
+}
+
+HRESULT OggDemuxOutputPin::GetMediaType(int inPosition, CMediaType* outMediaType) 
+{
+	//Put it in from the info we got in the constructor.
+	if (inPosition == 0) 
+    {
+		AM_MEDIA_TYPE locAMMediaType;
+		locAMMediaType.majortype = MEDIATYPE_OggPacketStream;
+
+		locAMMediaType.subtype = MEDIASUBTYPE_None;
+		locAMMediaType.formattype = FORMAT_OggIdentHeader;
+		locAMMediaType.cbFormat = getIdentSize();
+		locAMMediaType.pbFormat = getIdentAsFormatBlock();
+		locAMMediaType.pUnk = NULL;
+	
+		CMediaType locMediaType(locAMMediaType);		
+		*outMediaType = locMediaType;
+		return S_OK;
+    }
+        
+    return VFW_S_NO_MORE_ITEMS;
+}
+
+HRESULT OggDemuxOutputPin::CheckMediaType(const CMediaType* inMediaType) 
+{
+	if (inMediaType->majortype == MEDIATYPE_OggPacketStream &&
+		inMediaType->subtype == MEDIASUBTYPE_None &&
+		inMediaType->formattype == FORMAT_OggIdentHeader) 
+    {
+		//&&	(inMediaType->cbFormat == mBOSPage->pageSize()) {
+		return S_OK;
+    }
+    
+    return E_FAIL;
+}
+
+HRESULT OggDemuxOutputPin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) 
+{
+	HRESULT hr = S_OK;
+
+	ALLOCATOR_PROPERTIES locReqAlloc = *inoutInputRequest;
+	ALLOCATOR_PROPERTIES locActualAlloc;
+
+	hr = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+	if (hr != S_OK) 
+    {
+		return hr;
+	}
+
+	m_numBuffers = locActualAlloc.cBuffers;
+	hr = inoutAllocator->Commit();
+
+    LOG(logINFO) << __FUNCTIONW__ << " BufferSize: " << locActualAlloc.cbBuffer << ", Buffers: " << locActualAlloc.cBuffers;
+
+	return hr;
+}
+
+//Pin Conenction Methods
+HRESULT OggDemuxOutputPin::BreakConnect()
+{
+	delete m_dataQueue;
+	m_dataQueue = NULL;
+	return CBaseOutputPin::BreakConnect();
+}
+
+HRESULT OggDemuxOutputPin::CompleteConnect(IPin *inReceivePin)
+{
+    CComPtr<IOggDecoder> decoder;
+    inReceivePin->QueryInterface(IID_IOggDecoder, (void**)&decoder);
+	if (decoder != NULL) 
+    {
+		m_decoderInterface = decoder;
+
+		IOggDecoder::eAcceptHeaderResult result = m_decoderInterface->showHeaderPacket(m_identHeader->clone());
+		if (result == IOggDecoder::AHR_ALL_HEADERS_RECEIVED) 
+        {
+			m_isStreamReady = true;
+		} 
+        else 
+        {
+			OggPacketiser packetiser;
+			packetiser.setPacketSink(this);
+            std::vector<OggPage*> locList = GetFilter()->getMatchingBufferedPages(m_serialNo);
+			
+			for (size_t i = 0; i < locList.size(); i++) 
+            {
+				packetiser.acceptOggPage(locList[i]);
+			}
+
+			GetFilter()->removeMatchingBufferedPages(m_serialNo);	
+		}
+
+		if (m_isStreamReady) 
+        {
+			HRESULT hr = CBaseOutputPin::CompleteConnect(inReceivePin);
+			if (hr == S_OK) 
+            {
+				GetFilter()->notifyPinConnected();
+				m_dataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, m_numBuffers);
+				
+                return S_OK;
+			}  
+            else 
+            {
+				return hr;
+			}
+		}	
+	}
+	return E_FAIL;
+}
+
+bool OggDemuxOutputPin::dispatchPacket(StampedOggPacket* inPacket)
+{
+	CAutoLock locStreamLock(GetFilter()->streamLock());
+
+	//Set up the sample info
+	IMediaSample* locSample = NULL;
+	REFERENCE_TIME locStart = inPacket->startTime();
+	REFERENCE_TIME locStop = inPacket->endTime();
+	
+	//Get a delivery buffer
+	HRESULT	locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
+	
+	//Error checks
+	if (locHR != S_OK) 
+    {
+		//Stopping, flushing or error
+
+		delete inPacket;
+		return false;
+	}
+
+	//Set time stamps. These are granule pos, and may be -1
+	locSample->SetTime(&locStart, &locStop);
+	
+	locSample->SetMediaTime(&locStart, &locStop);
+	locSample->SetSyncPoint(TRUE);
+	
+
+	// Create a pointer for the samples buffer
+	BYTE* locBuffer = NULL;
+	locSample->GetPointer(&locBuffer);
+
+	if (static_cast<unsigned long>(locSample->GetSize()) >= inPacket->packetSize()) 
+    {
+		memcpy(locBuffer, inPacket->packetData(), inPacket->packetSize());
+		locSample->SetActualDataLength(inPacket->packetSize());
+
+		locHR = m_dataQueue->Receive(locSample);
+
+		if (locHR != S_OK) 
+        {
+            LOG(logERROR) << __FUNCTIONW__ << " Failure... Queue rejected sample, error: 0x" << std::hex << locHR;
+			//Stopping ??
+
+			delete inPacket;
+			return false;
+		} 
+        else 
+        {
+			delete inPacket;
+			return true;
+		}
+	} 
+    else 
+    {
+		LOG(logERROR) << __FUNCTIONW__ << " Buffer to small. " << locSample->GetSize() << " vs " << inPacket->packetSize();
+		throw 0;
+	}	
+}
+
+bool OggDemuxOutputPin::acceptStampedOggPacket(StampedOggPacket* inPacket)
+{
+	if (m_acceptingData) 
+    {
+		return dispatchPacket(inPacket);
+	} 
+    else 
+    {
+		//This handles callbacks with header packets
+		IOggDecoder::eAcceptHeaderResult locResult;
+		if ((m_decoderInterface != NULL) && (!m_isStreamReady)) 
+        {
+			locResult = m_decoderInterface->showHeaderPacket(inPacket);
+			if (locResult == IOggDecoder::AHR_ALL_HEADERS_RECEIVED) 
+            {
+				m_isStreamReady = true;
+			}
+		}
+		delete inPacket;
+		return true;
+	}
+}
+
+//Pin streaming methods
+HRESULT OggDemuxOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+	NewSegment(tStart, tStop, dRate);
+
+	if (m_dataQueue != NULL) 
+    {
+		m_dataQueue->NewSegment(tStart, tStop, dRate);
+	}
+
+	return S_OK;
+}
+
+HRESULT OggDemuxOutputPin::DeliverEndOfStream()
+{
+	if (m_dataQueue != NULL) 
+    {
+		m_dataQueue->EOS();
+	}
+    return S_OK;
+}
+
+HRESULT OggDemuxOutputPin::DeliverEndFlush()
+{
+	CAutoLock locPackLock(m_packetiserLock);
+	
+	if (m_dataQueue != NULL) 
+    {
+		m_dataQueue->EndFlush();
+	}
+
+	m_packetiser.reset();
+    return S_OK;
+}
+
+HRESULT OggDemuxOutputPin::DeliverBeginFlush()
+{
+	if (m_dataQueue != NULL) 
+    {
+		m_dataQueue->BeginFlush();
+	}
+	
+    return S_OK;
+}
+
+bool OggDemuxOutputPin::notifyStreamBaseTime(__int64 inStreamTime)
+{
+	return GetFilter()->notifyStreamBaseTime(inStreamTime);
+}
+
+__int64 OggDemuxOutputPin::getGlobalBaseTime()
+{
+	return GetFilter()->getGlobalBaseTime();
+}
+
+bool OggDemuxOutputPin::IsStreamReady()
+{
+    return m_isStreamReady;
+}
+
+void OggDemuxOutputPin::SetIsStreamReady(bool inIsStreamReady)
+{
+    m_isStreamReady = inIsStreamReady;
+}
+
+OggDemuxFilter* OggDemuxOutputPin::GetFilter()
+{
+    return static_cast<OggDemuxFilter*>(m_pFilter);
+}

Copied: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.h (from rev 17148, trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.h)
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.h	                        (rev 0)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxOutputPin.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -0,0 +1,117 @@
+//===========================================================================
+//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//Copyright (C) 2010 Cristian Adam
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+//  notice, this list of conditions and the following disclaimer in the
+//  documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors 
+//  may be used to endorse or promote products derived from this software 
+//  without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include <libOOOgg/OggPacket.h>
+#include <libOOOgg/IOggCallback.h>
+#include <libOOOgg/OggPacketiser.h>
+#include "IOggDecoder.h"
+#include "IOggOutputPin.h"
+
+class OggDemuxFilter;
+
+class OggDemuxOutputPin
+	:	public CBaseOutputPin
+	,	public BasicSeekPassThrough
+	,	public IOggCallback
+	,	public IOggOutputPin
+	,	protected IStampedOggPacketSink
+{
+public:
+
+	DECLARE_IUNKNOWN
+	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+	//OggDemuxOutputPin();
+	OggDemuxOutputPin(	TCHAR* inObjectName, 
+						OggDemuxFilter* inParentFilter,
+						CCritSec* inFilterLock,
+						OggPacket* inIdentHeader,
+						unsigned long inSerialNo);
+	virtual ~OggDemuxOutputPin();
+
+	static const unsigned long NUM_PAGE_BUFFERS = 100;
+
+	unsigned long getSerialNo();
+	CComPtr<IOggDecoder> getDecoderInterface();
+	bool IsStreamReady();
+	void SetIsStreamReady(bool inIsStreamReady);
+
+	//IOggCallback Interface
+	virtual bool acceptOggPage(OggPage* inOggPage);
+
+
+	//CBasePin virtuals
+	virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+	virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+	virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+	//Pin Conenction Methods
+	virtual HRESULT BreakConnect();
+	virtual HRESULT CompleteConnect(IPin *inReceivePin);
+
+	//Pin streaming methods
+	virtual HRESULT DeliverNewSegment(REFERENCE_TIME inStart, REFERENCE_TIME inStop, double inRate);
+	virtual HRESULT DeliverEndOfStream();
+	virtual HRESULT DeliverEndFlush();
+	virtual HRESULT DeliverBeginFlush();
+
+	//IOggOutputPin interface
+	virtual bool notifyStreamBaseTime(__int64 inStreamTime);
+	virtual __int64 getGlobalBaseTime();
+protected:
+	//IStampedOggPacketSink
+	virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
+	virtual bool dispatchPacket(StampedOggPacket* inPacket);
+
+    OggDemuxFilter* GetFilter();
+private:
+
+	//What is this actually for ?
+	HRESULT mFilterHR;
+
+	BYTE* getIdentAsFormatBlock();
+	unsigned long getIdentSize();
+	unsigned long m_serialNo;
+
+	CCritSec* m_packetiserLock;
+
+	unsigned long m_numBuffers;
+	
+	OggPacket* m_identHeader;
+	CComPtr<IOggDecoder> m_decoderInterface;
+	OggPacketiser m_packetiser;
+
+	COutputQueue* m_dataQueue;
+
+	bool m_isStreamReady;
+	bool m_acceptingData;
+};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,949 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
-//Copyright (C) 2009 Cristian Adam
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "OggDemuxPacketSourceFilter.h"
-#include "OggStreamMapper.h"
-#include "ds_guids.h"
-#include "common/Log.h"
-#include "common/util.h"
-
-// This template lets the Object factory create us properly and work with COM infrastructure.
-CFactoryTemplate g_Templates[] = 
-{
-    { 
-        OggDemuxPacketSourceFilter::NAME,			// Name
-	    &CLSID_OggDemuxPacketSourceFilter,          // CLSID
-	    OggDemuxPacketSourceFilter::CreateInstance,	// Method to create an instance of MyComponent
-        NULL,									    // Initialization function
-        &OggDemuxPacketSourceFilter::m_filterReg    // Set-up information (for filters)
-    }
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 
-
-const wchar_t* OggDemuxPacketSourceFilter::NAME = L"Xiph.Org Ogg Demuxer";
-
-const AMOVIESETUP_PIN OggDemuxPacketSourceFilter::m_pinReg = 
-{	
-    L"Ogg Packet Out",					//Name (obsoleted)
-    FALSE,								//Renders from this pin ?? Not sure about this.
-    TRUE,								//Is an output pin
-    TRUE,								//Can have zero instances of this pin
-    TRUE,								//Can have more than one instance of this pin
-    &GUID_NULL,							//Connects to filter (obsoleted)
-    NULL,								//Connects to pin (obsoleted)
-    1,									//Only support one media type
-    &m_mediaTypes	                    //Pointer to media type (Audio/Vorbis or Audio/Speex)	
-};
-
-const AMOVIESETUP_FILTER OggDemuxPacketSourceFilter::m_filterReg = 
-{
-    &CLSID_OggDemuxPacketSourceFilter,  // Filter CLSID.
-    NAME,                               // Filter name.
-    MERIT_NORMAL,                       // Merit.
-    1,                                  // Number of pin types.
-    &m_pinReg                           // Pointer to pin information.
-};
-
-const AMOVIESETUP_MEDIATYPE OggDemuxPacketSourceFilter::m_mediaTypes = 
-{
-    &MEDIATYPE_OggPacketStream,
-    &MEDIASUBTYPE_None
-};
-
-
-#ifdef WINCE
-LPAMOVIESETUP_FILTER OggDemuxPacketSourceFilter::GetSetupData()
-{	
-	return (LPAMOVIESETUP_FILTER)&m_pinReg;	
-}
-#endif
-
-//COM Creator Function
-CUnknown* WINAPI OggDemuxPacketSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr) 
-{
-    util::ConfigureLogSettings();
-
-    OggDemuxPacketSourceFilter *pNewObject = new (std::nothrow) OggDemuxPacketSourceFilter();
-    if (pNewObject == NULL) 
-    {
-        *pHr = E_OUTOFMEMORY;
-    }
-    return pNewObject;
-} 
-
-OggDemuxPacketSourceFilter::OggDemuxPacketSourceFilter()
-	:	CBaseFilter(NAME, NULL, m_pLock, CLSID_OggDemuxPacketSourceFilter)
-	,	mDataSource(NULL)
-	,	mSeenAllBOSPages(false)
-	,	mSeenPositiveGranulePos(false)
-	,	mPendingPage(NULL)
-	,	mJustReset(true)
-	,	mSeekTable(NULL)
-	,	mGlobalBaseTime(0)
-	,	mUsingCustomSource(false)
-{
-	LOG(logDEBUG) << L"Creating OggDemuxPacketSourceFilter object";
-
-	//Why do we do this, should the base class do it ?
-	m_pLock = new CCritSec;
-
-	mSourceFileLock = new CCritSec;
-	mDemuxLock = new CCritSec;
-	mStreamLock = new CCritSec;
-
-	mStreamMapper = new OggStreamMapper(this, m_pLock);
-}
-
-OggDemuxPacketSourceFilter::~OggDemuxPacketSourceFilter()
-{
-	LOG(logDEBUG) << L"Destroying OggDemuxPacketSourceFilter";
-
-    delete mStreamMapper;
-	delete mSeekTable;
-	//TODO::: Delete the locks
-
-	delete mDemuxLock;
-	delete mStreamLock;
-	delete mSourceFileLock;
-
-	if (mDataSource)
-	{
-		mDataSource->close();
-		delete mDataSource;
-	}
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-    LOG(logDEBUG) << L"NonDelegatingQueryInterface: " << riid;
-
-    //TODO::: Possibly want to add a check when someone queries for ICustomSource and then disallow IFileSource
-    //			and vice versa, but that could cause a problem if applications just want to query out of
-    //			curiosity but not actually use it.
-    //
-    //			For now, using ICustomSource is pretty much unsupported, so if you are using it, you just have to
-    //			be careful you don't try and load a file twice by accident.
-
-    if (riid == IID_IFileSourceFilter) 
-    {
-        return GetInterface((IFileSourceFilter*)this, ppv);
-    } 
-    else if (riid == IID_ICustomSource) 
-    {
-        return GetInterface((ICustomSource*)this, ppv);
-    }  
-    else if (riid == IID_IAMFilterMiscFlags) 
-    {
-        return GetInterface((IAMFilterMiscFlags*)this, ppv);
-    }  
-    else if (riid == IID_IOggBaseTime) 
-    {
-        return GetInterface((IOggBaseTime*)this, ppv);
-    }
-
-    return CBaseFilter::NonDelegatingQueryInterface(riid, ppv); 
-}
-
-//IMEdiaStreaming
-STDMETHODIMP OggDemuxPacketSourceFilter::Run(REFERENCE_TIME tStart) 
-{
-	CAutoLock locLock(m_pLock);
-    LOG(logDEBUG) << "Run: " << ReferenceTime(tStart);
-	
-    return CBaseFilter::Run(tStart);
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::Pause() 
-{
-	CAutoLock locLock(m_pLock);
-    LOG(logDEBUG) << L"Pause";
-
-	if (m_State == State_Stopped) 
-    {
-        LOG(logDEBUG) <<L"Pause -- was stopped";
-
-		if (ThreadExists() == FALSE) 
-        {
-            LOG(logDEBUG) << L"Pause -- CREATING THREAD";
-			Create();
-		}
-
-        LOG(logDEBUG) << L"Pause -- RUNNING THREAD";
-		CallWorker(THREAD_RUN);
-	}
-
-	HRESULT hr = CBaseFilter::Pause();
-
-    LOG(logDEBUG) << L"Pause() COMPLETE. Base class returned: 0x" << std::hex << hr;
-	
-	return hr;	
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::Stop(void) 
-{
-	CAutoLock locLock(m_pLock);
-    LOG(logDEBUG) << L"Stop -- Closing worker THREAD";
-
-	CallWorker(THREAD_EXIT);
-	Close();
-	DeliverBeginFlush();
-	//mSetIgnorePackets = true;
-	DeliverEndFlush();
-	
-	return CBaseFilter::Stop();
-}
-
-void OggDemuxPacketSourceFilter::DeliverBeginFlush() 
-{
-	CAutoLock locLock(m_pLock);
-    LOG(logDEBUG) << L"DeliverBeginFlush";
-	
-	for (unsigned long i = 0; i < mStreamMapper->numPins(); i++) 
-    {
-		mStreamMapper->getPinByIndex(i)->DeliverBeginFlush();
-	}
-
-	//Should this be here or endflush or neither ?
-	resetStream();
-}
-
-void OggDemuxPacketSourceFilter::DeliverEndFlush() 
-{
-	CAutoLock locLock(m_pLock);
-    LOG(logDEBUG) << L"DeliverEndFlush";
-
-	for (unsigned long i = 0; i < mStreamMapper->numPins(); i++) 
-    {
-		//mStreamMapper->getOggStream(i)->flush();
-		mStreamMapper->getPinByIndex(i)->DeliverEndFlush();
-	}
-}
-
-void OggDemuxPacketSourceFilter::DeliverEOS() 
-{
-	//mStreamMapper->toStartOfData();
-    CAutoLock locStreamLock(mStreamLock);
-    LOG(logDEBUG) <<L"Deliver EOS";
-	
-    for (unsigned long i = 0; i < mStreamMapper->numPins(); i++) 
-    {
-		//mStreamMapper->getOggStream(i)->flush();
-		mStreamMapper->getPinByIndex(i)->DeliverEndOfStream();
-	}
-
-    resetStream();
-}
-
-void OggDemuxPacketSourceFilter::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) 
-{
-    CAutoLock locStreamLock(mStreamLock);
-	LOG(logDEBUG) << L"DeliverNewSegment";
-	
-    for (unsigned long i = 0; i < mStreamMapper->numPins(); i++) 
-    {
-		mStreamMapper->getPinByIndex(i)->DeliverNewSegment(tStart, tStop, dRate);
-	}
-}
-
-void OggDemuxPacketSourceFilter::resetStream() 
-{
-	{   
-		CAutoLock locDemuxLock(mDemuxLock);
-		CAutoLock locSourceLock(mSourceFileLock);
-        LOG(logDEBUG) << L"---RESET STREAM::: post locks";
-
-		mOggBuffer.clearData();
-
-		//For a custom data source, we send it a clear request to reset any error state.
-		//For normal source, we close down the source and re-open it.
-		mDataSource->clear();
-
-		if (!mUsingCustomSource) 
-        {
-			mDataSource->close();
-			delete mDataSource;
-			mDataSource = NULL;
-
-			//Before opening make the interface
-			mDataSource = DataSourceFactory::createDataSource(m_fileName);
-
-			mDataSource->open(m_fileName);
-		}
-		
-        mDataSource->seek(0);   //Should always be zero for now.
-
-		//TODO::: Should be doing stuff with the demux state here ? or packetiser ?>?
-		
-		mJustReset = true;   //TODO::: Look into this !
-        LOG(logDEBUG) << L"---RESET STREAM::: JUST RESET = TRUE";
-	}
-}
-
-bool OggDemuxPacketSourceFilter::acceptOggPage(OggPage* inOggPage)
-{
-	if (!mSeenAllBOSPages) 
-    {
-		if (!inOggPage->header()->isBOS()) 
-        {
-			mSeenAllBOSPages = true;
-			mBufferedPages.push_back(inOggPage);
-			return true;
-		} 
-        else 
-        {
-			LOG(logDEBUG) << "Found BOS";
-			return mStreamMapper->acceptOggPage(inOggPage);
-		}
-	} 
-    else if (!mSeenPositiveGranulePos) 
-    {
-		if (inOggPage->header()->GranulePos() > 0) 
-        {
-			mSeenPositiveGranulePos = true;
-		}
-		
-        mBufferedPages.push_back(inOggPage);
-		return true;
-	} 
-    else 
-    {
-		//OGGCHAIN::: Here, need to check for an eos, and reset stream, else do it in strmapper
-		return mStreamMapper->acceptOggPage(inOggPage);
-	}
-}
-
-HRESULT OggDemuxPacketSourceFilter::SetUpPins()
-{
-	CAutoLock locDemuxLock(mDemuxLock);
-	CAutoLock locSourceLock(mSourceFileLock);
-	
-	LOG(logDEBUG) << L"Setup Pins - Post lock";
-
-	unsigned short locRetryCount = 0;
-	const unsigned short RETRY_THRESHOLD = 3;
-
-	//For custom sources, we expect that the source will be provided open and ready
-	if (!mUsingCustomSource) 
-    {
-		//Create and open a data source if we are using the standard source.
-
-		LOG(logDEBUG) << L"Pre data source creation";
-
-		//mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(m_fileName).c_str());
-        mDataSource = DataSourceFactory::createDataSource(m_fileName);
-
-		LOG(logDEBUG) << L"Post data source creation";
-
-		if (mDataSource == NULL) 
-        {
-			return VFW_E_CANNOT_RENDER;
-		}
-		
-		if (!mDataSource->open(m_fileName)) 
-        {
-			return VFW_E_CANNOT_RENDER;
-		}
-	} 
-    else 
-    {
-		//For custom sources seek to the start, just in case
-		mDataSource->seek(0);
-	}
-	
-	//Error check
-	
-	//Register a callback
-	mOggBuffer.registerVirtualCallback(this);
-
-	char* locBuff = new char[SETUP_BUFFER_SIZE];
-	unsigned long locNumRead = 0;
-
-	//Feed the data in until we have seen all BOS pages.
-	while (!mSeenPositiveGranulePos) 
-    {			
-        //mStreamMapper->allStreamsReady()) {
-	
-		locNumRead = mDataSource->read(locBuff, SETUP_BUFFER_SIZE);
-	
-		if (locNumRead > 0) 
-        {
-			mOggBuffer.feed((const unsigned char*)locBuff, locNumRead);
-		}
-
-		if (mDataSource->isEOF() || mDataSource->isError()) 
-        {
-			if (mDataSource->isError() && (mDataSource->shouldRetryAt() != L"") && (locRetryCount < RETRY_THRESHOLD) && !mUsingCustomSource) 
-            {
-				mOggBuffer.clearData();
-				wstring locNewLocation = mDataSource->shouldRetryAt();
-
-				//debugLog<<"Retrying at : "<<locNewLocation<<endl;
-				delete mDataSource;
-				mDataSource = DataSourceFactory::createDataSource(locNewLocation);
-				mDataSource->open(locNewLocation);
-				locRetryCount++;
-			    //This prevents us dying on small files, if we hit eof but we also saw a +'ve gran pos, this file is ok.
-			} 
-            else if (!(mDataSource->isEOF() && mSeenPositiveGranulePos)) 
-            {
-				LOG(logDEBUG) << L"Bailing out";
-
-				delete[] locBuff;
-				return VFW_E_CANNOT_RENDER;
-			}
-		}
-	}
-	
-	//mStreamMapper->setAllowDispatch(true);
-	//mStreamMapper->();			//Flushes all streams and sets them to ignore the right number of headers.
-	mOggBuffer.clearData();
-	//mDataSource->clear();
-	mDataSource->seek(0);			//TODO::: This is bad for streams.
-
-	LOG(logDEBUG) << "COMPLETED SETUP";
-
-	delete[] locBuff;
-	
-    return S_OK;
-}
-
-vector<OggPage*> OggDemuxPacketSourceFilter::getMatchingBufferedPages(unsigned long inSerialNo)
-{
-	vector<OggPage*> locList;
-	for (size_t i = 0; i < mBufferedPages.size(); i++) 
-    {
-		if (mBufferedPages[i]->header()->StreamSerialNo() == inSerialNo) 
-        {
-			locList.push_back(mBufferedPages[i]->clone());
-		}
-	}
-	
-    return locList;
-}
-
-void OggDemuxPacketSourceFilter::removeMatchingBufferedPages(unsigned long inSerialNo)
-{
-	vector<OggPage*> locNewList;
-	int locSize = mBufferedPages.size();
-	
-    for (int i = 0; i < locSize; i++) 
-    {
-		if (mBufferedPages[i]->header()->StreamSerialNo() != inSerialNo) 
-        {
-			locNewList.push_back(mBufferedPages[i]);
-		} 
-        else 
-        {
-			delete mBufferedPages[i];
-		}
-	}
-
-	mBufferedPages = locNewList;
-}
-
-int OggDemuxPacketSourceFilter::GetPinCount() 
-{
-	//TODO::: Implement
-	return mStreamMapper->numPins();
-}
-
-CBasePin* OggDemuxPacketSourceFilter::GetPin(int inPinNo) 
-{
-	if (inPinNo < 0) 
-    {
-		return NULL;
-	}
-	return mStreamMapper->getPinByIndex(inPinNo);
-}
-
-HRESULT OggDemuxPacketSourceFilter::setCustomSourceAndLoad(IFilterDataSource* inDataSource)
-{
-	CAutoLock locLock(m_pLock);
-	mDataSource = inDataSource;
-	m_fileName = L"";
-	mUsingCustomSource = true;
-
-	return SetUpPins();
-}
-
-//IFileSource Interface
-STDMETHODIMP OggDemuxPacketSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) 
-{
-    CheckPointer(outFileName, E_POINTER);
-    *outFileName = NULL;
-
-    if (!m_fileName.empty()) 
-    {
-    	unsigned int size  = sizeof(WCHAR) * (m_fileName.size() + 1);
-
-        *outFileName = (LPOLESTR) CoTaskMemAlloc(size);
-        if (*outFileName != NULL) 
-        {
-            CopyMemory(*outFileName, m_fileName.c_str(), size);
-        }
-    }
-	
-	return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) 
-{
-	CAutoLock locLock(m_pLock);
-	
-	m_fileName = inFileName;
-
-    LOG(logINFO) << L"OggDemuxPacketSourceFilter::Load(" << m_fileName << L")";
-
-	if (m_fileName.find(L"XsZZfQ__WiiPFD.anx") == m_fileName.size() - 18)
-    {
-		m_fileName = m_fileName.substr(0, m_fileName.size() - 18);	
-	}
-
-	HRESULT hr = SetUpPins();
-	if (FAILED(hr)) 
-    {
-        LOG(logDEBUG) << L"Load failed, error: 0x" << std::hex << hr;
-	}
-
-    return hr;
-}
-
-//IAMFilterMiscFlags Interface
-ULONG OggDemuxPacketSourceFilter::GetMiscFlags(void) 
-{
-	return AM_FILTER_MISC_FLAGS_IS_SOURCE;
-}
-
-//CAMThread Stuff
-DWORD OggDemuxPacketSourceFilter::ThreadProc(void) 
-{	
-	while(true) 
-    {
-		DWORD locThreadCommand = GetRequest();
-	
-		switch(locThreadCommand) 
-        {
-			case THREAD_EXIT:
-	
-				Reply(S_OK);
-                LOG(logDEBUG) << L"Thread Proc --- THREAD IS EXITING";
-				return S_OK;
-
-			case THREAD_RUN:
-	
-				Reply(S_OK);
-				DataProcessLoop();
-                LOG(logDEBUG) << L"Thread Proc --- Data Process Loop has returned";
-				break;
-		}
-	}
-
-	return S_OK;
-}
-
-void OggDemuxPacketSourceFilter::notifyPinConnected()
-{
-	LOG(logDEBUG) << L"Notify pin connected";
-	if (mStreamMapper->allStreamsReady()) 
-    {
-		//Setup the seek table.
-		if (mSeekTable == NULL) 
-        {
-			//CUSTOM SOURCE:::
-			if (!mUsingCustomSource) 
-            {
-				LOG(logDEBUG) << L"Setting up seek table";
-				//ZZUNICODE:::
-				//mSeekTable = new AutoOggChainGranuleSeekTable(StringHelper::toNarrowStr(m_fileName));
-				mSeekTable = new AutoOggChainGranuleSeekTable(m_fileName);
-				LOG(logDEBUG) << L"After Setting up seek table";
-			} 
-            else 
-            {
-				mSeekTable = new CustomOggChainGranuleSeekTable(mDataSource);
-			}
-			int locNumPins = GetPinCount();
-
-			OggDemuxPacketSourcePin* locPin = NULL;
-			for (int i = 0; i < locNumPins; i++) 
-            {
-				locPin = (OggDemuxPacketSourcePin*)GetPin(i);
-				
-				LOG(logDEBUG) << L"Adding decoder interface to seek table";
-				mSeekTable->addStream(locPin->getSerialNo(), locPin->getDecoderInterface());
-			}
-#ifndef WINCE
-			LOG(logDEBUG) << L"Pre seek table build";
-			mSeekTable->buildTable();
-			
-            LOG(logDEBUG) << L"Post seek table build";
-#endif
-		}
-	}
-}
-
-HRESULT OggDemuxPacketSourceFilter::DataProcessLoop() 
-{
-	//Mess with the locking mechanisms at your own risk.
-
-	//debugLog<<"Starting DataProcessLoop :"<<endl;
-	DWORD locCommand = 0;
-	char* locBuff = new  char[4096];			//Deleted before function returns...
-	//TODO::: Make this a member variable ^^^^^
-	bool locKeepGoing = true;
-	unsigned long locBytesRead = 0;
-	bool locIsEOF = true;
-
-	OggDataBuffer::eFeedResult locFeedResult;
-
-	{
-		CAutoLock locSourceLock(mSourceFileLock);
-		locIsEOF = mDataSource->isEOF();
-	}
-
-	bool continueLooping = true;
-	while (continueLooping) 
-    {
-		if (CheckRequest(&locCommand) == TRUE) 
-        {
-			LOG(logDEBUG) << L"DataProcessLoop : Thread Command issued... leaving loop.";
-
-			delete[] locBuff;
-			return S_OK;
-		}
-		//debugLog<<"Looping..."<<endl;
-		{
-			CAutoLock locSourceLock(mSourceFileLock);
-
-			locBytesRead = mDataSource->read(locBuff, 4096);
-			mJustReset = false;
-		}
-
-		try
-		{
-			//debugLog <<"DataProcessLoop : gcount = "<<locBytesRead<<endl;
-			{
-				CAutoLock locDemuxLock(mDemuxLock);
-				//CAutoLock locStreamLock(mStreamLock);
-                //To avoid blocking problems... restart the loop if it was just reset while waiting for lock.
-				if (mJustReset) 
-                {		
-                    LOG(logDEBUG) << L"DataProcessLoop : Detected JustRest condition";
-					continue;
-				}
-				locFeedResult = mOggBuffer.feed((const unsigned char*)locBuff, locBytesRead);
-				locKeepGoing = ((locFeedResult == (OggDataBuffer::FEED_OK)) || (locFeedResult == OggDataBuffer::PROCESS_DISPATCH_FALSE));;
-				if (locFeedResult != OggDataBuffer::FEED_OK)
-				{
-					LOG(logDEBUG) << L"Feed result = "<<locFeedResult;
-					break;
-				}
-			}
-			//if (!locKeepGoing) {
-			//	//debugLog << "DataProcessLoop : Feed in data buffer said stop"<<endl;
-	  //          CAutoLock locStreamLock(mStreamLock);
-			//	debugLog<<L"DataProcessLoop : Keep going false Deliver EOS"<<endl;
-	  //          debugLog<<L"Feed Result = "<<locFeedResult<<endl;
-			//	DeliverEOS();
-			//}
-			{
-				CAutoLock locSourceLock(mSourceFileLock);
-				locIsEOF = mDataSource->isEOF();
-			}
-		}
-		catch (int)
-		{
-			locIsEOF = true;
-			continueLooping = false;
-		}
-
-		if (locIsEOF) 
-        {
-			//debugLog << "DataProcessLoop : EOF"<<endl;
-            CAutoLock locStreamLock(mStreamLock);
-			LOG(logDEBUG) << L"DataProcessLoop : EOF Deliver EOS";
-			DeliverEOS();
-		}
-	}
-
-	LOG(logDEBUG) << L"DataProcessLoop : Left loop., baling out";
-
-	//should we flush here ?
-	delete[] locBuff;
-	
-	//return value ??
-	return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetCapabilities(DWORD* inCapabilities) 
-{
-	if (mSeekTable == NULL || !mSeekTable->enabled())  
-    {
-        *inCapabilities = 0;
-        return S_OK;;
-    }
-
-	*inCapabilities = mSeekingCap;
-    return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetDuration(LONGLONG* pDuration) 
-{
-	if (mSeekTable == NULL || !mSeekTable->enabled()) 
-    {
-        return E_NOTIMPL;
-    }
-
-	*pDuration = mSeekTable->fileDuration();
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetDuration(" << ReferenceTime(*pDuration) << ") -> 0x" << std::hex << S_OK;
-
-    return S_OK;
-}
-	 
-STDMETHODIMP OggDemuxPacketSourceFilter::CheckCapabilities(DWORD *pCapabilities)
-{
-    HRESULT result = S_OK;
-
-    DWORD dwActual;
-    GetCapabilities(&dwActual);
-    if (*pCapabilities & (~dwActual))
-    {
-        result = S_FALSE;
-    }
-
-    LOG(logDEBUG3) << "IMediaSeeking::CheckCapabilities(" << *pCapabilities << ") -> 0x" << std::hex << result;
-
-    return result;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::IsFormatSupported(const GUID *pFormat)
-{
-    HRESULT result = S_FALSE;
-
-    if (*pFormat == TIME_FORMAT_MEDIA_TIME) 
-    {
-        result = S_OK;
-    } 
-
-    LOG(logDEBUG3) << "IMediaSeeking::IsFormatSupported(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
-
-    return result;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::QueryPreferredFormat(GUID *pFormat)
-{
-	*pFormat = TIME_FORMAT_MEDIA_TIME;
-
-    LOG(logDEBUG3) << "IMediaSeeking::QueryPreferredFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK; 
-
-	return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::SetTimeFormat(const GUID *pFormat)
-{
-    LOG(logDEBUG3) << "IMediaSeeking::SetTimeFormat(" << ToString(pFormat) << ") -> 0x" << std::hex << E_NOTIMPL; 
-	
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetTimeFormat( GUID *pFormat)
-{
-	*pFormat = TIME_FORMAT_MEDIA_TIME;
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << S_OK; 
-
-    return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetStopPosition(LONGLONG *pStop)
-{
-	if (mSeekTable == NULL || !mSeekTable->enabled())  
-    {
-        return E_NOTIMPL;
-    }
-
-    *pStop = mSeekTable->fileDuration();
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetStopPosition(" << ReferenceTime(*pStop) << ") -> 0x" << std::hex << S_OK;
-
-	return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetCurrentPosition(LONGLONG *pCurrent)
-{
-	return E_NOTIMPL;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
-{
-    LOG(logDEBUG3) << "IMediaSeeking::ConvertTimeFormat(" << ToString(pTarget) 
-        << ", " << ToString(pTargetFormat) << ", " << ToString(Source)
-        << ", " << ToString(pSourceFormat) << ") -> 0x" << std::hex << E_NOTIMPL;
-
-    return E_NOTIMPL;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags)
-{
-    CAutoLock locLock(m_pLock);
-
-    LOG(logDEBUG3) << "IMediaSeeking::SetPositions(" << ReferenceTime(*pCurrent) << ", " << dwCurrentFlags
-        << ", " << ReferenceTime(*pStop) << ", " << dwStopFlags << ") -> 0x" << std::hex << S_OK;
-
-    if (mSeekTable == NULL || !mSeekTable->enabled())  
-    {
-        return E_NOTIMPL;
-    }
-	
-	CAutoLock locSourceLock(mSourceFileLock);
-	DeliverBeginFlush();
-	
-	//Find the byte position for this time.
-	if (*pCurrent > mSeekTable->fileDuration()) 
-    {
-		*pCurrent = mSeekTable->fileDuration();
-	} 
-    else if (*pCurrent < 0) 
-    {
-		*pCurrent = 0;
-	}
-
-	OggGranuleSeekTable::tSeekPair locStartPos = mSeekTable->seekPos(*pCurrent);
-		
-	//For now, seek to the position directly, later we will discard the preroll
-	//Probably don't ever want to do this. We want to record the desired time,
-	//	and it will be up to the decoders to drop anything that falls before it.
-	
-    DeliverEndFlush();
-	DeliverNewSegment(*pCurrent, mSeekTable->fileDuration(), 1.0);
-
-	//.second is the file position.
-	mDataSource->seek(locStartPos.second.first);
-
-	return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop)
-{
-	return E_NOTIMPL;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest)
-{
-    if (mSeekTable == NULL || !mSeekTable->enabled())  
-    {
-        return E_NOTIMPL;
-    }
-
-    *pEarliest = 0;
-    *pLatest = mSeekTable->fileDuration();
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetAvailable(" << ToString(*pEarliest) << ", " << ToString(*pLatest)
-                   << ") -> 0x" << std::hex << S_OK;
-
-    return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::SetRate(double dRate)
-{
-    HRESULT result = VFW_E_UNSUPPORTED_AUDIO;
-
-    if (dRate == 1.00f)
-    {
-        result = S_OK;
-    }
-    else if (dRate <= 0.00f)
-    {
-        result = E_INVALIDARG;
-    }
-
-    LOG(logDEBUG3) << "IMediaSeeking::SetRate(" << std::setprecision(3) << std::showpoint
-                   << dRate << ") -> 0x" << std::hex << result;
-
-    return result;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetRate(double *dRate)
-{
-    *dRate = 1.0;
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetRate(" << std::setprecision(3) << std::showpoint
-                   << *dRate << ") -> 0x" << std::hex << S_OK;
-
-    return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::GetPreroll(LONGLONG *pllPreroll)
-{
-    *pllPreroll = 0;
-
-    LOG(logDEBUG3) << "IMediaSeeking::GetPreroll(" << ToString(*pllPreroll) << ") -> 0x" << std::hex << S_OK;
-
-    return S_OK;
-}
-
-STDMETHODIMP OggDemuxPacketSourceFilter::IsUsingTimeFormat(const GUID *pFormat) 
-{
-    HRESULT result = S_FALSE;
-
-    if (*pFormat == TIME_FORMAT_MEDIA_TIME) 
-    {
-        result = S_OK;
-    }
-
-    LOG(logDEBUG3) << "IMediaSeeking::IsUsingTimeFormat(" << ToString(*pFormat) << ") -> 0x" << std::hex << result;
-
-    return result;
-}
-
-bool OggDemuxPacketSourceFilter::notifyStreamBaseTime(__int64 inStreamBaseTime)
-{
-	if (inStreamBaseTime > mGlobalBaseTime) 
-    {
-		mGlobalBaseTime = inStreamBaseTime;
-	}
-	
-    return true;
-}
-
-__int64 OggDemuxPacketSourceFilter::getGlobalBaseTime()
-{
-	return mGlobalBaseTime;
-}
-
-CCritSec* OggDemuxPacketSourceFilter::streamLock()
-{
-    return mStreamLock;
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourceFilter.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,171 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
-//Copyright (C) 2009 Cristian Adam
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "BasicSeekPassThrough.h"
-#include "IFilterDataSource.h"
-#include "IOggBaseTime.h"
-#include "ICustomSource.h"
-//#include "OggStreamMapper.h"
-#include <libOOOgg/OggDataBuffer.h>
-
-#include <libOOOggSeek/AutoOggChainGranuleSeekTable.h>
-#include "CustomOggChainGranuleSeekTable.h"
-#include "DataSourceFactory.h"
-
-class OggStreamMapper;
-
-class OggDemuxPacketSourceFilter:	
-    public CBaseFilter,	
-    public CAMThread,	
-    public IFileSourceFilter,	
-    public IOggCallback,	
-    public IOggBaseTime,	
-    public ICustomSource,	
-    public BasicSeekPassThrough,	
-    public IAMFilterMiscFlags
-{
-public:
-	OggDemuxPacketSourceFilter();
-	virtual ~OggDemuxPacketSourceFilter();
-
-    enum eThreadCommands 
-    {
-		THREAD_EXIT = 0,
-		THREAD_PAUSE = 1,
-		THREAD_RUN = 2
-	};
-
-	//Com Stuff
-	DECLARE_IUNKNOWN
-
-    static const wchar_t* NAME;
-    static const AMOVIESETUP_MEDIATYPE m_mediaTypes;
-    static const AMOVIESETUP_PIN m_pinReg;
-    static const AMOVIESETUP_FILTER m_filterReg;
-
-	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-	static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
-	//Streaming MEthods
-	STDMETHODIMP Run(REFERENCE_TIME tStart);
-	STDMETHODIMP Pause(void);
-	STDMETHODIMP Stop(void);
-
-#ifdef WINCE
-	virtual LPAMOVIESETUP_FILTER GetSetupData();
-#endif
-
-	//IOggCallback Interface
-	virtual bool acceptOggPage(OggPage* inOggPage);
-
-	//PURE VIRTUALS From CBaseFilter
-	virtual int GetPinCount();
-	virtual CBasePin* GetPin(int inPinNo);
-
-	//PURE VIRTUALS from CAMThread
-	virtual DWORD ThreadProc(void);
-
-	//IFileSource Interface
-	virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
-	virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
-	//ICustomSource Interface
-	virtual HRESULT setCustomSourceAndLoad(IFilterDataSource* inDataSource);
-
-	//IAMFilterMiscFlags Interface
-	ULONG STDMETHODCALLTYPE GetMiscFlags(void);
-
-	//IMediaSeeking
-	virtual STDMETHODIMP GetDuration(LONGLONG* outDuration);
-	virtual STDMETHODIMP GetCapabilities(DWORD* inCapabilities);
-	 
-	virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
-	virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
-	virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
-	virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
-	virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
-	
-	virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
-	virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
-	virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
-	virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
-	virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
-	virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
-	virtual STDMETHODIMP SetRate(double dRate);
-	virtual STDMETHODIMP GetRate(double *dRate);
-	virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
-	virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
-
-	vector<OggPage*> getMatchingBufferedPages(unsigned long inSerialNo);
-	void removeMatchingBufferedPages(unsigned long inSerialNo);
-
-	CCritSec* streamLock();
-
-	virtual void notifyPinConnected();
-	virtual bool notifyStreamBaseTime(__int64 inStreamBaseTime);
-
-	//IOggBaseTime Interface
-	virtual __int64 getGlobalBaseTime();
-
-protected:
-	static const unsigned long SETUP_BUFFER_SIZE = 24;
-	virtual HRESULT SetUpPins();
-
-	void resetStream();
-	HRESULT DataProcessLoop();
-
-	void DeliverEOS();
-	void DeliverBeginFlush();
-	void DeliverEndFlush();
-	void DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-	CCritSec* mSourceFileLock;
-	CCritSec* mDemuxLock;
-	CCritSec* mStreamLock;
-
-	wstring m_fileName;
-
-	bool mSeenAllBOSPages;
-	bool mSeenPositiveGranulePos;
-	OggPage* mPendingPage;
-	vector<OggPage*> mBufferedPages;
-
-	OggDataBuffer mOggBuffer;
-	IFilterDataSource* mDataSource;
-	OggStreamMapper* mStreamMapper;
-
-	AutoOggChainGranuleSeekTable* mSeekTable;
-
-	bool mUsingCustomSource;
-	bool mJustReset;
-	__int64 mGlobalBaseTime;
-};

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,403 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "ds_guids.h"
-#include ".\OggDemuxPacketsourcepin.h"
-#include "common/Log.h"
-
-OggDemuxPacketSourcePin::	OggDemuxPacketSourcePin(		TCHAR* inObjectName
-												,	OggDemuxPacketSourceFilter* inParentFilter
-												,	CCritSec* inFilterLock
-												,	OggPacket* inIdentHeader
-												,	unsigned long inSerialNo)
-	:	CBaseOutputPin(			NAME("Ogg Demux Output Pin")
-							,	inParentFilter
-							,	inFilterLock
-							,	&mFilterHR
-							,	L"Ogg Stream" )
-	,	mIdentHeader(inIdentHeader)
-	,	mSerialNo(inSerialNo)
-	,	mIsStreamReady(false)
-	,	mAcceptingData(false)
-	,	mNumBuffers(0)
-	,	mDataQueue(NULL)
-	,	mFilterHR(S_OK)
-{
-
-	mPacketiserLock = new CCritSec;
-	
-	//(BYTE*)inBOSPage->createRawPageData();
-	mPacketiser.setPacketSink(this);
-
-	//Subvert COM and do this directly... this way, the source filter won't expose the interface to the
-	// graph but we can still delegate to it.
-	IMediaSeeking* locSeeker = (IMediaSeeking*)inParentFilter;
-	SetDelegate(locSeeker);
-}
-STDMETHODIMP OggDemuxPacketSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-	if (riid == IID_IMediaSeeking) 
-    {
-		//debugLog<<"Pin queried for IMediaSeeking"<<endl;
-		*ppv = (IMediaSeeking*)this;
-		((IUnknown*)*ppv)->AddRef();
-		return NOERROR;
-	} 
-    else if (riid == IID_IOggOutputPin) 
-    {
-		*ppv = (IOggOutputPin*)this;
-		//((IUnknown*)*ppv)->AddRef();
-		return NOERROR;		
-	}
-
-	return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 
-}
-
-OggDemuxPacketSourcePin::~OggDemuxPacketSourcePin()
-{
-	//Since we didn't addref the filter when we set the seek delegate onto it, we have to avoid
-	//	it getting released, so set it to NULL, to avoid the destructor releasing it.
-	SetDelegate(NULL);
-	//delete[] mBOSAsFormatBlock;
-	//delete mBOSPage;
-	delete mIdentHeader;
-	delete mDataQueue;
-
-	delete mPacketiserLock;
-}
-
-bool OggDemuxPacketSourcePin::acceptOggPage(OggPage* inOggPage)
-{
-	CAutoLock locPackLock(mPacketiserLock);
-	if (mIsStreamReady) 
-    {
-		mAcceptingData = true;
-		return mPacketiser.acceptOggPage(inOggPage);
-	} 
-    else 
-    {
-		delete inOggPage;
-	}
-	
-    return false;
-}
-BYTE* OggDemuxPacketSourcePin::getIdentAsFormatBlock()
-{
-	return (BYTE*)mIdentHeader->packetData();
-}
-
-unsigned long OggDemuxPacketSourcePin::getIdentSize()
-{
-	return mIdentHeader->packetSize();
-}
-
-unsigned long OggDemuxPacketSourcePin::getSerialNo()
-{
-	return mSerialNo;//mBOSPage->header()->StreamSerialNo();
-}
-
-IOggDecoder* OggDemuxPacketSourcePin::getDecoderInterface()
-{
-	if (mDecoderInterface == NULL) 
-    {
-		IOggDecoder* locDecoder = NULL;
-		if (IsConnected()) 
-        {
-			IPin* locPin = GetConnected();
-			if (locPin != NULL) 
-            {
-				locPin->QueryInterface(IID_IOggDecoder, (void**)&locDecoder);
-			}
-		}
-
-		mDecoderInterface = locDecoder;
-	}
-	return mDecoderInterface;
-	
-}
-HRESULT OggDemuxPacketSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) 
-{
-	//Put it in from the info we got in the constructor.
-	if (inPosition == 0) 
-    {
-		AM_MEDIA_TYPE locAMMediaType;
-		locAMMediaType.majortype = MEDIATYPE_OggPacketStream;
-
-		locAMMediaType.subtype = MEDIASUBTYPE_None;
-		locAMMediaType.formattype = FORMAT_OggIdentHeader;
-		locAMMediaType.cbFormat = getIdentSize();
-		locAMMediaType.pbFormat = getIdentAsFormatBlock();
-		locAMMediaType.pUnk = NULL;
-	
-			
-	
-		CMediaType locMediaType(locAMMediaType);		
-		*outMediaType = locMediaType;
-		return S_OK;
-    }
-        
-    return VFW_S_NO_MORE_ITEMS;
-}
-
-HRESULT OggDemuxPacketSourcePin::CheckMediaType(const CMediaType* inMediaType) {
-	if (		(inMediaType->majortype == MEDIATYPE_OggPacketStream) 
-			&&	(inMediaType->subtype == MEDIASUBTYPE_None)
-			&&	(inMediaType->formattype == FORMAT_OggIdentHeader)) 
-    {
-			//&&	(inMediaType->cbFormat == mBOSPage->pageSize()) {
-		return S_OK;
-    }
-    
-    return E_FAIL;
-}
-
-HRESULT OggDemuxPacketSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) 
-{
-	HRESULT locHR = S_OK;
-
-	ALLOCATOR_PROPERTIES locReqAlloc = *inoutInputRequest;
-	ALLOCATOR_PROPERTIES locActualAlloc;
-
-	//locReqAlloc.cbAlign = 1;
-	//locReqAlloc.cbBuffer = 65536; //BUFFER_SIZE;
-	//locReqAlloc.cbPrefix = 0;
-	//locReqAlloc.cBuffers = NUM_PAGE_BUFFERS; //NUM_BUFFERS;
-
-	locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
-	if (locHR != S_OK) 
-    {
-		return locHR;
-	}
-
-	mNumBuffers = locActualAlloc.cBuffers;
-	locHR = inoutAllocator->Commit();
-
-    LOG(logINFO) << __FUNCTIONW__ << " BufferSize: " << locActualAlloc.cbBuffer << ", Buffers: " << locActualAlloc.cBuffers;
-
-	return locHR;
-}
-
-
-//Pin Conenction Methods
-HRESULT OggDemuxPacketSourcePin::BreakConnect()
-{
-	delete mDataQueue;
-	mDataQueue = NULL;
-	return CBaseOutputPin::BreakConnect();
-}
-
-HRESULT OggDemuxPacketSourcePin::CompleteConnect(IPin *inReceivePin)
-{
-	IOggDecoder* locDecoder = NULL;
-	inReceivePin->QueryInterface(IID_IOggDecoder, (void**)&locDecoder);
-	if (locDecoder != NULL) 
-    {
-		mDecoderInterface = locDecoder;
-
-		IOggDecoder::eAcceptHeaderResult locResult = mDecoderInterface->showHeaderPacket(mIdentHeader->clone());
-		if (locResult == IOggDecoder::AHR_ALL_HEADERS_RECEIVED) 
-        {
-			mIsStreamReady = true;
-
-		} 
-        else 
-        {
-			OggPacketiser locPacketiser;
-			locPacketiser.setPacketSink(this);
-			OggDemuxPacketSourceFilter* locParent = (OggDemuxPacketSourceFilter*)m_pFilter;
-			vector<OggPage*> locList = locParent->getMatchingBufferedPages(mSerialNo);
-			
-			for (size_t i = 0; i < locList.size(); i++) 
-            {
-				locPacketiser.acceptOggPage(locList[i]);
-			}
-
-			locParent->removeMatchingBufferedPages(mSerialNo);	
-		}
-
-		if (mIsStreamReady) 
-        {
-			HRESULT locHR = CBaseOutputPin::CompleteConnect(inReceivePin);
-			if (locHR == S_OK) 
-            {
-				((OggDemuxPacketSourceFilter*)m_pFilter)->notifyPinConnected();
-				mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, mNumBuffers);
-				
-                return S_OK;
-			}  
-            else 
-            {
-				return locHR;
-			}
-		}	
-	}
-	return E_FAIL;
-	
-}
-
-bool OggDemuxPacketSourcePin::dispatchPacket(StampedOggPacket* inPacket)
-{
-	CAutoLock locStreamLock(((OggDemuxPacketSourceFilter*)m_pFilter)->streamLock());
-
-	//Set up the sample info
-	IMediaSample* locSample = NULL;
-	REFERENCE_TIME locStart = inPacket->startTime();
-	REFERENCE_TIME locStop = inPacket->endTime();
-	
-	//Get a delivery buffer
-	HRESULT	locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
-	
-	//Error checks
-	if (locHR != S_OK) 
-    {
-		//Stopping, flushing or error
-
-		delete inPacket;
-		return false;
-	}
-
-	//Set time stamps. These are granule pos, and may be -1
-	locSample->SetTime(&locStart, &locStop);
-	
-	locSample->SetMediaTime(&locStart, &locStop);
-	locSample->SetSyncPoint(TRUE);
-	
-
-	// Create a pointer for the samples buffer
-	BYTE* locBuffer = NULL;
-	locSample->GetPointer(&locBuffer);
-
-	if (locSample->GetSize() >= inPacket->packetSize()) 
-    {
-
-		memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
-		locSample->SetActualDataLength(inPacket->packetSize());
-
-		locHR = mDataQueue->Receive(locSample);
-
-		if (locHR != S_OK) 
-        {
-            LOG(logERROR) << __FUNCTIONW__ << " Failure... Queue rejected sample, error: 0x" << std::hex << locHR;
-			//Stopping ??
-
-			delete inPacket;
-			return false;
-		} 
-        else 
-        {
-			delete inPacket;
-			return true;
-		}
-	} 
-    else 
-    {
-		LOG(logERROR) << __FUNCTIONW__ << " Buffer to small. " << locSample->GetSize() << " vs " << inPacket->packetSize();
-		throw 0;
-	}	
-}
-
-bool OggDemuxPacketSourcePin::acceptStampedOggPacket(StampedOggPacket* inPacket)
-{
-	if (mAcceptingData) 
-    {
-		return dispatchPacket(inPacket);
-	} 
-    else 
-    {
-		//This handles callbacks with header packets
-		IOggDecoder::eAcceptHeaderResult locResult;
-		if ((mDecoderInterface != NULL) && (!mIsStreamReady)) 
-        {
-			locResult = mDecoderInterface->showHeaderPacket(inPacket);
-			if (locResult == IOggDecoder::AHR_ALL_HEADERS_RECEIVED) 
-            {
-				mIsStreamReady = true;
-			}
-		}
-		delete inPacket;
-		return true;
-	}
-}
-
-//Pin streaming methods
-HRESULT OggDemuxPacketSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
-	NewSegment(tStart, tStop, dRate);
-
-	if (mDataQueue != NULL) 
-    {
-		mDataQueue->NewSegment(tStart, tStop, dRate);
-	}
-
-	return S_OK;
-}
-
-HRESULT OggDemuxPacketSourcePin::DeliverEndOfStream()
-{
-	if (mDataQueue != NULL) 
-    {
-		mDataQueue->EOS();
-	}
-    return S_OK;
-}
-
-HRESULT OggDemuxPacketSourcePin::DeliverEndFlush()
-{
-	CAutoLock locPackLock(mPacketiserLock);
-	
-	if (mDataQueue != NULL) 
-    {
-		mDataQueue->EndFlush();
-	}
-
-	mPacketiser.reset();
-    return S_OK;
-}
-
-HRESULT OggDemuxPacketSourcePin::DeliverBeginFlush()
-{
-	if (mDataQueue != NULL) 
-    {
-		mDataQueue->BeginFlush();
-	}
-	
-    return S_OK;
-}
-
-bool OggDemuxPacketSourcePin::notifyStreamBaseTime(__int64 inStreamTime)
-{
-	return ((OggDemuxPacketSourceFilter*)m_pFilter)->notifyStreamBaseTime(inStreamTime);
-}
-__int64 OggDemuxPacketSourcePin::getGlobalBaseTime()
-{
-	return ((OggDemuxPacketSourceFilter*)m_pFilter)->getGlobalBaseTime();
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggDemuxPacketSourcePin.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,117 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include <libOOOgg/OggPacket.h>
-#include <libOOOgg/IOggCallback.h>
-#include <libOOOgg/OggPacketiser.h>
-#include "IOggDecoder.h"
-#include "IOggOutputPin.h"
-
-class OggDemuxPacketSourcePin
-	:	public CBaseOutputPin
-	,	public BasicSeekPassThrough
-	,	public IOggCallback
-	,	public IOggOutputPin
-	,	protected IStampedOggPacketSink
-{
-public:
-
-	DECLARE_IUNKNOWN
-	STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-	//OggDemuxPacketSourcePin();
-	OggDemuxPacketSourcePin(	TCHAR* inObjectName, 
-							OggDemuxPacketSourceFilter* inParentFilter,
-							CCritSec* inFilterLock,
-							OggPacket* inIdentHeader,
-							unsigned long inSerialNo);
-							//StreamHeaders* inHeaderSource, 
-							//CMediaType* inMediaType,
-							//wstring inPinName,
-							//bool inAllowSeek,
-							//unsigned long inNumBuffers,
-							//unsigned long inBufferSize);
-	virtual ~OggDemuxPacketSourcePin();
-
-	static const unsigned long NUM_PAGE_BUFFERS = 100;
-
-	unsigned long getSerialNo();
-	IOggDecoder* getDecoderInterface();
-	bool isStreamReady()							{		return mIsStreamReady;				}
-	void setIsStreamReady(bool inIsStreamReady)		{		mIsStreamReady = inIsStreamReady;	}
-
-	//IOggCallback Interface
-	virtual bool acceptOggPage(OggPage* inOggPage);
-
-
-	//CBasePin virtuals
-	virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
-	virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
-	virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
-
-	//Pin Conenction Methods
-	virtual HRESULT BreakConnect();
-	virtual HRESULT CompleteConnect(IPin *inReceivePin);
-
-	//Pin streaming methods
-	virtual HRESULT DeliverNewSegment(REFERENCE_TIME inStart, REFERENCE_TIME inStop, double inRate);
-	virtual HRESULT DeliverEndOfStream();
-	virtual HRESULT DeliverEndFlush();
-	virtual HRESULT DeliverBeginFlush();
-
-	//IOggOutputPin interface
-	virtual bool notifyStreamBaseTime(__int64 inStreamTime);
-	virtual __int64 getGlobalBaseTime();
-protected:
-	//IStampedOggPacketSink
-	virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
-	virtual bool dispatchPacket(StampedOggPacket* inPacket);
-
-	//What is this actually for ?
-	HRESULT mFilterHR;
-
-	BYTE* getIdentAsFormatBlock();
-	unsigned long getIdentSize();
-	unsigned long mSerialNo;
-
-	CCritSec* mPacketiserLock;
-
-	unsigned long mNumBuffers;
-	
-	OggPacket* mIdentHeader;
-	IOggDecoder* mDecoderInterface;
-	OggPacketiser mPacketiser;
-
-	COutputQueue* mDataQueue;
-
-	bool mIsStreamReady;
-	bool mAcceptingData;
-};

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,7 +1,9 @@
 #include "StdAfx.h"
-#include ".\oggstreammapper.h"
+#include "OggStreamMapper.h"
+#include "OggDemuxFilter.h"
+#include "OggDemuxOutputPin.h"
 
-OggStreamMapper::OggStreamMapper(OggDemuxPacketSourceFilter* inParentFilter, CCritSec* inParentFilterLock):	
+OggStreamMapper::OggStreamMapper(OggDemuxFilter* inParentFilter, CCritSec* inParentFilterLock):	
 mStreamState(STRMAP_READY),	
 mParentFilter(inParentFilter),	
 mParentFilterLock(inParentFilterLock),	
@@ -18,7 +20,7 @@
 	}
 }
 
-OggDemuxPacketSourcePin* OggStreamMapper::getPinByIndex(unsigned long inIndex)
+OggDemuxOutputPin* OggStreamMapper::getPinByIndex(unsigned long inIndex)
 {
 	if (inIndex < mPins.size()) 
     {
@@ -68,7 +70,7 @@
 				//		int x = 2;
 				//	}
 				// }
-				OggDemuxPacketSourcePin* locPin = getMatchingPin(inOggPage->header()->StreamSerialNo());
+				OggDemuxOutputPin* locPin = getMatchingPin(inOggPage->header()->StreamSerialNo());
 				if (locPin != NULL) 
                 {
 					return locPin->acceptOggPage(inOggPage);
@@ -92,10 +94,10 @@
 bool OggStreamMapper::allStreamsReady()
 {
 	bool locAllReady = true;
-	//OggDemuxPacketSourcePin* locPin = NULL;
+	//OggDemuxOutputPin* locPin = NULL;
 	for (size_t i = 0; i < mPins.size(); i++) 
     {
-		locAllReady = locAllReady && mPins[i]->isStreamReady();
+		locAllReady = locAllReady && mPins[i]->IsStreamReady();
 	}	
 
 	return locAllReady && (mPins.size() > 0);
@@ -137,7 +139,7 @@
 	} 
     else 
     {
-		OggDemuxPacketSourcePin* locNewPin = new OggDemuxPacketSourcePin(NAME("OggPageSourcePin"), mParentFilter, mParentFilterLock, inOggPage->getPacket(0)->clone(), inOggPage->header()->StreamSerialNo());
+		OggDemuxOutputPin* locNewPin = new OggDemuxOutputPin(NAME("OggPageSourcePin"), mParentFilter, mParentFilterLock, inOggPage->getPacket(0)->clone(), inOggPage->header()->StreamSerialNo());
 		//locNewPin->AddRef();
 		delete inOggPage;
 		mPins.push_back(locNewPin);
@@ -145,9 +147,9 @@
 	}
 }
 
-OggDemuxPacketSourcePin* OggStreamMapper::getMatchingPin(unsigned long inSerialNo)
+OggDemuxOutputPin* OggStreamMapper::getMatchingPin(unsigned long inSerialNo)
 {
-	OggDemuxPacketSourcePin* locPin = NULL;
+	OggDemuxOutputPin* locPin = NULL;
 	for (size_t i = 0; i < mPins.size(); i++) 
     {
 		locPin = mPins[i];

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/OggStreamMapper.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -3,6 +3,9 @@
 #include <libOOOgg/IOggCallback.h>
 #include <vector>
 
+class OggDemuxFilter;
+class OggDemuxOutputPin;
+
 class OggStreamMapper:	public IOggCallback
 {
 public:
@@ -16,7 +19,7 @@
 		STRMAP_ERROR
 
 	};
-	OggStreamMapper(OggDemuxPacketSourceFilter* inParentFilter, CCritSec* inParentFilterLock);
+	OggStreamMapper(OggDemuxFilter* inParentFilter, CCritSec* inParentFilterLock);
 	virtual ~OggStreamMapper(void);
 
 	//IOggCallback Interface
@@ -27,19 +30,19 @@
 	bool allStreamsReady();
 
 	unsigned long numPins()				{		return mPins.size();		}
-	OggDemuxPacketSourcePin* getPinByIndex(unsigned long inIndex);
+	OggDemuxOutputPin* getPinByIndex(unsigned long inIndex);
 
 protected:
 	eStreamState mStreamState;
-    std::vector<OggDemuxPacketSourcePin*> mPins;
-	OggDemuxPacketSourceFilter* mParentFilter;
+    std::vector<OggDemuxOutputPin*> mPins;
+	OggDemuxFilter* mParentFilter;
 	CCritSec* mParentFilterLock;
 
 	OggPacket* mFishHeadPacket;
 	unsigned long mSkeletonSerialNo;
 
 	bool addNewPin(OggPage* inOggPage);
-	OggDemuxPacketSourcePin* getMatchingPin(unsigned long inSerialNo);
+	OggDemuxOutputPin* getMatchingPin(unsigned long inSerialNo);
 
 	bool handleFishHead(OggPage* inOggPage);
 	bool isFishHead(OggPage* inOggPage);

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ReadMe.txt
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ReadMe.txt	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ReadMe.txt	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,40 +0,0 @@
-========================================================================
-    DYNAMIC LINK LIBRARY : dsfOggDemux2 Project Overview
-========================================================================
-
-AppWizard has created this dsfOggDemux2 DLL for you.  
-This file contains a summary of what you will find in each of the files that
-make up your dsfOggDemux2 application.
-
-
-dsfOggDemux2.vcproj
-    This is the main project file for VC++ projects generated using an Application Wizard. 
-    It contains information about the version of Visual C++ that generated the file, and 
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-dsfOggDemux2.cpp
-    This is the main DLL source file.
-
-	When created, this DLL does not export any symbols. As a result, it  
-	will not produce a .lib file when it is built. If you wish this project 
-	to be a project dependency of some other project, you will either need to 
-	add code to export some symbols from the DLL so that an export library 
-	will be produced, or you can set the Ignore Input Library property to Yes 
-	on the General propert page of the Linker folder in the project's Property 
-	Pages dialog box.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named dsfOggDemux2.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,125 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include ".\singlemediafilecache.h"
-
-SingleMediaFileCache::SingleMediaFileCache(void)
-	:	mBytesWritten(0)
-	,	mIsComplete(false)
-	,	mReadPtr(0)
-{
-	//debugLog.open("G:\\logs\\mediacache.log", ios_base::out);
-}
-
-SingleMediaFileCache::~SingleMediaFileCache(void)
-{
-	//debugLog.close();
-}
-
-bool SingleMediaFileCache::open(string inFileName) {
-	mBytesWritten = 0;
-	//debugLog<<"Opening "<<inFileName<<endl;
-	mLocalFile.open(inFileName.c_str(), ios_base::in|ios_base::out|ios_base::binary|ios_base::trunc);
-
-	if (mLocalFile.is_open()) {
-		//debugLog<<"File open...."<<endl;
-	} else {
-		//debugLog<<"File open FAILED"<<endl;
-	}
-	return mLocalFile.is_open();
-}
-void SingleMediaFileCache::close() {
-	mLocalFile.close();
-	
-}
-bool SingleMediaFileCache::write(const unsigned char* inBuff, unsigned long inBuffSize) {
-	//debugLog<<"Writeing "<<inBuffSize<<endl;
-	//debugLog<<"Read Ptr = "<<mLocalFile.tellg();
-	//debugLog<<"Write Ptr = "<<mLocalFile.tellp();
-	mLocalFile.seekp(0, ios_base::end);
-	if (inBuffSize != 0) {
-		mLocalFile.write((const char*)inBuff, inBuffSize);
-		mBytesWritten += inBuffSize;
-	}
-
-	if (mLocalFile.fail()) {
-		//debugLog<<"*** Write put into FAIL"<<endl;
-	}
-	return !(mLocalFile.fail());
-}
-unsigned long SingleMediaFileCache::read(unsigned char* outBuff, unsigned long inBuffSize) {
-	//debugLog<<"Read request for "<<inBuffSize<<"  got ";
-	//debugLog<<"Read Ptr = "<<mLocalFile.tellg();
-	//debugLog<<"Write Ptr = "<<mLocalFile.tellp();
-	mLocalFile.seekg(mReadPtr);
-	unsigned long locBytesAvail = bytesAvail();
-	if (locBytesAvail >= inBuffSize) {
-        mLocalFile.read((char*)outBuff, inBuffSize);
-        //debugLog<<mLocalFile.gcount()<<endl;
-		mReadPtr+=mLocalFile.gcount();
-		return mLocalFile.gcount();
-	} else if (locBytesAvail > 0) {
-		mLocalFile.read((char*)outBuff, locBytesAvail);
-		//debugLog<<locBytesAvail<<endl;
-		mReadPtr += locBytesAvail;
-		return locBytesAvail;
-	} else {
-		//debugLog << "NOTHING"<<endl;
-		return 0;
-	}
-	
-}
-bool SingleMediaFileCache::readSeek(unsigned long inSeekPos) {
-	if (inSeekPos < mBytesWritten) {
-		//debugLog<<"Seeking to "<<inSeekPos<<endl;
-		mReadPtr = inSeekPos;
-		return true;
-	} else {
-		return false;
-	}
-}
-
-unsigned long SingleMediaFileCache::totalBytes() {
-	return mBytesWritten;
-}
-unsigned long SingleMediaFileCache::bytesAvail() {
-	if (mLocalFile.fail()) {
-		//debugLog<<"bytesAvail : File is in fail state"<<endl;
-	}
-	//debugLog<<"bytesAvail : Byteswritten = "<<mBytesWritten<<endl;
-	//if ((!mLocalFile.fail()) && (mBytesWritten > 0)) {
-	if (mBytesWritten > 0) {
-		//debugLog<<"bytes Avail = "<<mBytesWritten - mReadPtr<<endl;
-		return mBytesWritten - mReadPtr;
-	} else {
-		return 0;
-	}
-}

Deleted: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/SingleMediaFileCache.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,67 +0,0 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-//  notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-//  notice, this list of conditions and the following disclaimer in the
-//  documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors 
-//  may be used to endorse or promote products derived from this software 
-//  without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-//This class will be a cache of a single media file.
-//It will only allow a single chunk of data to be cached...
-// ie you can't cache bytes 0-1000 and 2000-3000...
-// only consecutive blocks for now.
-//
-//Data can be read randomly... but only written sequentially.
-//Will act as a buffer so that data read off the network can be put straight
-// into the file and then read as needed.
-
-#include <string>
-#include <fstream>
-using namespace std;
-class OGG_DEMUX2_API SingleMediaFileCache
-{
-public:
-	SingleMediaFileCache(void);
-	~SingleMediaFileCache(void);
-
-	bool open(string inFileName);
-	void close();
-	bool write(const unsigned char* inBuff, unsigned long inBuffSize);
-	unsigned long read(unsigned char* outBuff, unsigned long inBuffSize);
-	bool readSeek(unsigned long inSeekPos);
-	unsigned long totalBytes();
-	unsigned long bytesAvail();
-
-protected:
-	fstream mLocalFile;
-
-	unsigned long mBytesWritten;
-	unsigned long mReadPtr;
-	
-	//fstream debugLog;
-	bool mIsComplete;
-};

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ds_guids.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ds_guids.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/ds_guids.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,7 +1,15 @@
 #pragma once
 
+// Stream subtype for Ogg byte streams. The filter can handle
+// MEDIASUBTYPE_NULL, but specifying MEDIASUBTYPE_Ogg can save
+// the filter graph the trouble of trying out all the available
+// filters.
+// {DD142C1E-0C1E-4381-A24E-0B2D80B6098A}
+DEFINE_GUID(MEDIASUBTYPE_Ogg, 
+0xdd142c1e, 0xc1e, 0x4381, 0xa2, 0x4e, 0xb, 0x2d, 0x80, 0xb6, 0x9, 0x8a);
+
 // {C9361F5A-3282-4944-9899-6D99CDC5370B}
-DEFINE_GUID(CLSID_OggDemuxPacketSourceFilter, 
+DEFINE_GUID(CLSID_OggDemuxFilter, 
 0xc9361f5a, 0x3282, 0x4944, 0x98, 0x99, 0x6d, 0x99, 0xcd, 0xc5, 0x37, 0xb);
 
 // {60891713-C24F-4767-B6C9-6CA05B3338FC}
@@ -24,7 +32,3 @@
 DEFINE_GUID(IID_IOggBaseTime, 
 0xeb5aed9c, 0x8cd0, 0x4c4b, 0xb5, 0xe8, 0xf5, 0xd1, 0xa, 0xd1, 0x31, 0x4d);
 
-// {23EF732D-DAAF-41ee-85FB-BB97B1D01FF3}
-DEFINE_GUID(IID_ICustomSource, 
-0x23ef732d, 0xdaaf, 0x41ee, 0x85, 0xfb, 0xbb, 0x97, 0xb1, 0xd0, 0x1f, 0xf3);
-

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2-2005.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2-2005.vcproj	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2-2005.vcproj	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,324 +1,1082 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="dsfOggDemux2" ProjectGUID="{304B710A-7355-471C-A4A8-9E8F6D640E6D}" RootNamespace="dsfOggDemux2" Keyword="Win32Proj">
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="dsfOggDemux2"
+	ProjectGUID="{304B710A-7355-471C-A4A8-9E8F6D640E6D}"
+	RootNamespace="dsfOggDemux2"
+	Keyword="Win32Proj"
+	>
 	<Platforms>
-		<Platform Name="Win32"/>
-		<Platform Name="x64"/>
-		<Platform Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"/>
-		<Platform Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"/>
-		<Platform Name="Windows Mobile 6 Professional SDK (ARMV4I)"/>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+		<Platform
+			Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+		/>
+		<Platform
+			Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+		/>
+		<Platform
+			Name="Windows Mobile 6 Professional SDK (ARMV4I)"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
 	<Configurations>
-		<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool"/>
-			<Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS" MinimalRebuild="true" ExceptionHandling="2" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib " OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="2" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb" SubSystem="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="1"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCManifestTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCFxCopTool"/>
-			<Tool Name="VCAppVerifierTool"/>
-			<Tool Name="VCWebDeploymentTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				MinimalRebuild="true"
+				ExceptionHandling="2"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
 		</Configuration>
-		<Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="3"/>
-			<Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS" MinimalRebuild="true" ExceptionHandling="2" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib " OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="2" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb" SubSystem="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="17"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCManifestTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCFxCopTool"/>
-			<Tool Name="VCAppVerifierTool"/>
-			<Tool Name="VCWebDeploymentTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				MinimalRebuild="true"
+				ExceptionHandling="2"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
 		</Configuration>
-		<Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" MinimalRebuild="true" ExceptionHandling="2" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="2" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb" SubSystem="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles=""/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				MinimalRebuild="true"
+				ExceptionHandling="2"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
-		<Configuration Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" MinimalRebuild="true" ExceptionHandling="2" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="2" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb" SubSystem="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles=""/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				MinimalRebuild="true"
+				ExceptionHandling="2"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
-		<Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" MinimalRebuild="true" ExceptionHandling="2" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="4" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="2" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb" SubSystem="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles=""/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				MinimalRebuild="true"
+				ExceptionHandling="2"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
+				SubSystem="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
-		<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1" WholeProgramOptimization="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool"/>
-			<Tool Name="VCCLCompilerTool" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS" ExceptionHandling="2" RuntimeLibrary="2" UsePrecompiledHeader="2" WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib " OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="1" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="1"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCManifestTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCFxCopTool"/>
-			<Tool Name="VCAppVerifierTool"/>
-			<Tool Name="VCWebDeploymentTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				ExceptionHandling="2"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="2"
+				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
 		</Configuration>
-		<Configuration Name="Release|x64" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1" WholeProgramOptimization="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="3"/>
-			<Tool Name="VCCLCompilerTool" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS" ExceptionHandling="2" RuntimeLibrary="2" UsePrecompiledHeader="2" WarningLevel="4" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib " OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="1" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="17"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCManifestTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCFxCopTool"/>
-			<Tool Name="VCAppVerifierTool"/>
-			<Tool Name="VCWebDeploymentTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				ExceptionHandling="2"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="2"
+				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
 		</Configuration>
-		<Configuration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1" WholeProgramOptimization="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" ExceptionHandling="2" RuntimeLibrary="0" UsePrecompiledHeader="2" WarningLevel="4" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="1" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles=""/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				ExceptionHandling="2"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="2"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
-		<Configuration Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1" WholeProgramOptimization="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" ExceptionHandling="2" RuntimeLibrary="0" UsePrecompiledHeader="2" WarningLevel="4" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="1" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="%CSIDL_PROGRAM_FILES%\Xiph.Org\Ogg Codecs" RegisterOutput="-1" AdditionalFiles="$(TargetDir)\dsfVorbisDecoder.dll"/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				ExceptionHandling="2"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="2"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory="%CSIDL_PROGRAM_FILES%\Xiph.Org\Ogg Codecs"
+				RegisterOutput="-1"
+				AdditionalFiles="$(TargetDir)\dsfVorbisDecoder.dll"
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
-		<Configuration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="1" WholeProgramOptimization="1">
-			<Tool Name="VCPreBuildEventTool"/>
-			<Tool Name="VCCustomBuildTool"/>
-			<Tool Name="VCXMLDataGeneratorTool"/>
-			<Tool Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool Name="VCMIDLTool" TargetEnvironment="1"/>
-			<Tool Name="VCCLCompilerTool" ExecutionBucket="7" InlineFunctionExpansion="2" EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper" PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)" ExceptionHandling="2" RuntimeLibrary="0" UsePrecompiledHeader="2" WarningLevel="4" DebugInformationFormat="3" CallingConvention="0"/>
-			<Tool Name="VCManagedResourceCompilerTool"/>
-			<Tool Name="VCResourceCompilerTool"/>
-			<Tool Name="VCPreLinkEventTool"/>
-			<Tool Name="VCLinkerTool" AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib" OutputFile="$(OutDir)/dsfOggDemux2.dll" LinkIncremental="1" AdditionalLibraryDirectories="" ModuleDefinitionFile="dsfOggDemux2.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="$(OutDir)/dsfOggDemux2.lib" TargetMachine="0"/>
-			<Tool Name="VCALinkTool"/>
-			<Tool Name="VCXDCMakeTool"/>
-			<Tool Name="VCBscMakeTool"/>
-			<Tool Name="VCCodeSignTool"/>
-			<Tool Name="VCPostBuildEventTool"/>
-			<DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles=""/>
-			<DebuggerTool/>
+		<Configuration
+			Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="1"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				ExecutionBucket="7"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				ExceptionHandling="2"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="2"
+				WarningLevel="4"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
+				OutputFile="$(OutDir)/dsfOggDemux2.dll"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				ModuleDefinitionFile="dsfOggDemux2.def"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCCodeSignTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
 	</Configurations>
 	<References>
 	</References>
 	<Files>
-		<Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File RelativePath=".\CustomOggChainGranuleSeekTable.cpp">
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\CustomOggChainGranuleSeekTable.cpp"
+				>
 			</File>
-			<File RelativePath=".\DataSourceFactory.cpp">
-			</File>
-			<File RelativePath=".\ds_guids.cpp">
-				<FileConfiguration Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="2"/>
+			<File
+				RelativePath=".\ds_guids.cpp"
+				>
+				<FileConfiguration
+					Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="2"
+					/>
 				</FileConfiguration>
 			</File>
-			<File RelativePath=".\dsfOggDemux2.def">
+			<File
+				RelativePath=".\dsfOggDemux2.def"
+				>
 			</File>
-			<File RelativePath=".\FilterFileSource.cpp">
+			<File
+				RelativePath=".\OggDemuxFilter.cpp"
+				>
 			</File>
-			<File RelativePath=".\HTTPSocket.cpp">
+			<File
+				RelativePath=".\OggDemuxInputPin.cpp"
+				>
 			</File>
-			<File RelativePath=".\HTTPStreamingFileSource.cpp">
+			<File
+				RelativePath=".\OggDemuxOutputPin.cpp"
+				>
 			</File>
-			<File RelativePath=".\OggDemuxPacketSourceFilter.cpp">
+			<File
+				RelativePath=".\oggdllstuff.cpp"
+				>
 			</File>
-			<File RelativePath=".\OggDemuxPacketSourcePin.cpp">
+			<File
+				RelativePath=".\OggStreamMapper.cpp"
+				>
 			</File>
-			<File RelativePath=".\oggdllstuff.cpp">
-			</File>
-			<File RelativePath=".\OggStreamMapper.cpp">
-			</File>
-			<File RelativePath=".\SingleMediaFileCache.cpp">
-			</File>
-			<File RelativePath=".\stdafx.cpp">
-				<FileConfiguration Name="Debug|Win32">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+			<File
+				RelativePath=".\stdafx.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Debug|x64">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Release|Win32">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Release|x64">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
+				<FileConfiguration
+					Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
 				</FileConfiguration>
-				<FileConfiguration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
-				</FileConfiguration>
-				<FileConfiguration Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)">
-					<Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/>
-				</FileConfiguration>
 			</File>
 		</Filter>
-		<Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-			<File RelativePath=".\CustomOggChainGranuleSeekTable.h">
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\CustomOggChainGranuleSeekTable.h"
+				>
 			</File>
-			<File RelativePath=".\DataSourceFactory.h">
+			<File
+				RelativePath=".\ds_guids.h"
+				>
 			</File>
-			<File RelativePath=".\ds_guids.h">
+			<File
+				RelativePath=".\FilterFileSource.h"
+				>
 			</File>
-			<File RelativePath=".\FilterFileSource.h">
+			<File
+				RelativePath=".\IOggBaseTime.h"
+				>
 			</File>
-			<File RelativePath=".\HTTPSocket.h">
+			<File
+				RelativePath=".\IOggDecoder.h"
+				>
 			</File>
-			<File RelativePath=".\HTTPStreamingFileSource.h">
+			<File
+				RelativePath=".\IOggFilterSeeker.h"
+				>
 			</File>
-			<File RelativePath=".\ICustomSource.h">
+			<File
+				RelativePath=".\IOggOutputPin.h"
+				>
 			</File>
-			<File RelativePath=".\IFilterDataSource.h">
+			<File
+				RelativePath=".\OggDemuxFilter.h"
+				>
 			</File>
-			<File RelativePath=".\IOggBaseTime.h">
+			<File
+				RelativePath=".\OggDemuxInputPin.h"
+				>
 			</File>
-			<File RelativePath=".\IOggDecoder.h">
+			<File
+				RelativePath=".\OggDemuxOutputPin.h"
+				>
 			</File>
-			<File RelativePath=".\IOggFilterSeeker.h">
+			<File
+				RelativePath=".\oggdllstuff.h"
+				>
 			</File>
-			<File RelativePath=".\IOggOutputPin.h">
+			<File
+				RelativePath=".\OggStreamMapper.h"
+				>
 			</File>
-			<File RelativePath=".\OggDemuxPacketSourceFilter.h">
+			<File
+				RelativePath=".\stdafx.h"
+				>
 			</File>
-			<File RelativePath=".\OggDemuxPacketSourcePin.h">
-			</File>
-			<File RelativePath=".\oggdllstuff.h">
-			</File>
-			<File RelativePath=".\OggStreamMapper.h">
-			</File>
-			<File RelativePath=".\SingleMediaFileCache.h">
-			</File>
-			<File RelativePath=".\stdafx.h">
-			</File>
 		</Filter>
-		<Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
 		</Filter>
-		<File RelativePath="..\..\..\codecs\flac\filters\dsfNativeFLACSource\ReadMe.txt">
-		</File>
-		<File RelativePath=".\ReadMe.txt">
-		</File>
 	</Files>
 	<Globals>
 	</Globals>

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/dsfOggDemux2.vcproj	2010-05-03 22:38:42 UTC (rev 17188)
@@ -6,7 +6,6 @@
 	ProjectGUID="{304B710A-7355-471C-A4A8-9E8F6D640E6D}"
 	RootNamespace="dsfOggDemux2"
 	Keyword="Win32Proj"
-	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -85,8 +84,6 @@
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
 				SubSystem="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
 				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
 				TargetMachine="1"
 			/>
@@ -109,6 +106,9 @@
 				Name="VCAppVerifierTool"
 			/>
 			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
@@ -192,17 +192,19 @@
 				Name="VCAppVerifierTool"
 			/>
 			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
 		<Configuration
-			Name="Release|Win32"
+			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
 			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -218,22 +220,19 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
+				TargetEnvironment="1"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="true"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				ExecutionBucket="7"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				MinimalRebuild="true"
 				ExceptionHandling="2"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="2"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
 				WarningLevel="4"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -246,50 +245,48 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
-				LinkIncremental="1"
+				LinkIncremental="2"
 				AdditionalLibraryDirectories=""
 				ModuleDefinitionFile="dsfOggDemux2.def"
 				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
 				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				RandomizedBaseAddress="1"
-				DataExecutionPrevention="0"
 				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
-				TargetMachine="1"
+				TargetMachine="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
 				Name="VCBscMakeTool"
 			/>
 			<Tool
-				Name="VCFxCopTool"
+				Name="VCCodeSignTool"
 			/>
 			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
 				Name="VCPostBuildEventTool"
 			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
 		<Configuration
-			Name="Release|x64"
+			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
 			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="1"
-			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -305,23 +302,19 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
-				TargetEnvironment="3"
+				TargetEnvironment="1"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				InlineFunctionExpansion="2"
-				EnableIntrinsicFunctions="true"
-				FavorSizeOrSpeed="1"
-				OmitFramePointers="true"
-				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
+				ExecutionBucket="7"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				MinimalRebuild="true"
 				ExceptionHandling="2"
-				RuntimeLibrary="2"
-				UsePrecompiledHeader="2"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
 				WarningLevel="4"
-				Detect64BitPortabilityProblems="false"
-				DebugInformationFormat="3"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -334,42 +327,43 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
-				LinkIncremental="1"
+				LinkIncremental="2"
 				AdditionalLibraryDirectories=""
 				ModuleDefinitionFile="dsfOggDemux2.def"
 				GenerateDebugInformation="true"
+				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
 				SubSystem="2"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
 				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
-				TargetMachine="17"
+				TargetMachine="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
 				Name="VCBscMakeTool"
 			/>
 			<Tool
-				Name="VCFxCopTool"
+				Name="VCCodeSignTool"
 			/>
 			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
 				Name="VCPostBuildEventTool"
 			/>
+			<DeploymentTool
+				ForceDirty="-1"
+				RemoteDirectory=""
+				RegisterOutput="0"
+				AdditionalFiles=""
+			/>
+			<DebuggerTool
+			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
 			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
@@ -397,13 +391,12 @@
 				ExecutionBucket="7"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
-				RuntimeLibrary="3"
+				RuntimeLibrary="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="4"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -416,7 +409,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
 				LinkIncremental="2"
 				AdditionalLibraryDirectories=""
@@ -452,12 +445,13 @@
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+			Name="Release|Win32"
 			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="1"
+			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -473,19 +467,21 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
-				TargetEnvironment="1"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				ExecutionBucket="7"
-				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
-				MinimalRebuild="true"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
 				ExceptionHandling="2"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="2"
 				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
 				CallingConvention="0"
 			/>
 			<Tool
@@ -501,46 +497,49 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
-				LinkIncremental="2"
+				LinkIncremental="1"
 				AdditionalLibraryDirectories=""
 				ModuleDefinitionFile="dsfOggDemux2.def"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
 				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
 				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
-				TargetMachine="0"
+				TargetMachine="1"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
 				Name="VCBscMakeTool"
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
-				Name="VCPostBuildEventTool"
+				Name="VCAppVerifierTool"
 			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
+			<Tool
+				Name="VCWebDeploymentTool"
 			/>
-			<DebuggerTool
+			<Tool
+				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
 		<Configuration
-			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
+			Name="Release|x64"
 			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="2"
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			CharacterSet="1"
+			WholeProgramOptimization="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -556,19 +555,22 @@
 			/>
 			<Tool
 				Name="VCMIDLTool"
-				TargetEnvironment="1"
+				TargetEnvironment="3"
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				ExecutionBucket="7"
-				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
-				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
-				MinimalRebuild="true"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="true"
+				AdditionalIncludeDirectories="&quot;$(BASECLASSES)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
+				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_BIND_TO_CURRENT_CRT_VERSION;WIN32;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS"
 				ExceptionHandling="2"
-				RuntimeLibrary="3"
-				UsePrecompiledHeader="0"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="2"
 				WarningLevel="4"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
 				CallingConvention="0"
 			/>
 			<Tool
@@ -584,37 +586,39 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
-				LinkIncremental="2"
+				LinkIncremental="1"
 				AdditionalLibraryDirectories=""
 				ModuleDefinitionFile="dsfOggDemux2.def"
 				GenerateDebugInformation="true"
-				ProgramDatabaseFile="$(OutDir)/dsfOggDemux2.pdb"
 				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
 				ImportLibrary="$(OutDir)/dsfOggDemux2.lib"
-				TargetMachine="0"
+				TargetMachine="17"
 			/>
 			<Tool
 				Name="VCALinkTool"
 			/>
 			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
 				Name="VCXDCMakeTool"
 			/>
 			<Tool
 				Name="VCBscMakeTool"
 			/>
 			<Tool
-				Name="VCCodeSignTool"
+				Name="VCFxCopTool"
 			/>
 			<Tool
-				Name="VCPostBuildEventTool"
+				Name="VCAppVerifierTool"
 			/>
-			<DeploymentTool
-				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
+			<Tool
+				Name="VCWebDeploymentTool"
 			/>
-			<DebuggerTool
+			<Tool
+				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
 		<Configuration
@@ -651,11 +655,10 @@
 				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
 				ExceptionHandling="2"
-				RuntimeLibrary="2"
+				RuntimeLibrary="0"
 				UsePrecompiledHeader="2"
 				WarningLevel="4"
 				DebugInformationFormat="3"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -668,7 +671,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories=""
@@ -738,11 +741,10 @@
 				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
 				ExceptionHandling="2"
-				RuntimeLibrary="2"
+				RuntimeLibrary="0"
 				UsePrecompiledHeader="2"
 				WarningLevel="4"
 				DebugInformationFormat="3"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -755,7 +757,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories=""
@@ -784,9 +786,9 @@
 			/>
 			<DeploymentTool
 				ForceDirty="-1"
-				RemoteDirectory=""
-				RegisterOutput="0"
-				AdditionalFiles=""
+				RemoteDirectory="%CSIDL_PROGRAM_FILES%\Xiph.Org\Ogg Codecs"
+				RegisterOutput="-1"
+				AdditionalFiles="$(TargetDir)\dsfVorbisDecoder.dll"
 			/>
 			<DebuggerTool
 			/>
@@ -825,11 +827,10 @@
 				AdditionalIncludeDirectories="&quot;$(BASECLASSES_WINCE)&quot;;..\..\ogg;..\libDirectshowAbstracts;..\..\..\helper"
 				PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;DSFOGGDEMUX2_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_);$(PLATFORMDEFINES)"
 				ExceptionHandling="2"
-				RuntimeLibrary="2"
+				RuntimeLibrary="0"
 				UsePrecompiledHeader="2"
 				WarningLevel="4"
 				DebugInformationFormat="3"
-				CallingConvention="0"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -842,7 +843,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="Winmm.lib Strmiids.lib Quartz.lib Ole32.Lib AdvAPI32.Lib OleAut32.Lib user32.lib WSock32.Lib ShLwApi.Lib "
+				AdditionalDependencies="Strmiids.lib Ole32.Lib OleAut32.Lib Ws2.lib"
 				OutputFile="$(OutDir)/dsfOggDemux2.dll"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories=""
@@ -892,38 +893,34 @@
 				>
 			</File>
 			<File
-				RelativePath=".\DataSourceFactory.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\ds_guids.cpp"
 				>
+				<FileConfiguration
+					Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="2"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\dsfOggDemux2.def"
 				>
 			</File>
 			<File
-				RelativePath=".\FilterFileSource.cpp"
+				RelativePath=".\OggDemuxFilter.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\HTTPSocket.cpp"
+				RelativePath=".\OggDemuxInputPin.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\HTTPStreamingFileSource.cpp"
+				RelativePath=".\OggDemuxOutputPin.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\OggDemuxPacketSourceFilter.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\OggDemuxPacketSourcePin.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\oggdllstuff.cpp"
 				>
 			</File>
@@ -932,10 +929,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\SingleMediaFileCache.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\stdafx.cpp"
 				>
 				<FileConfiguration
@@ -955,7 +948,7 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Release|Win32"
+					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -963,7 +956,7 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Release|x64"
+					Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -971,7 +964,7 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+					Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -979,7 +972,7 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
+					Name="Release|Win32"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -987,7 +980,7 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"
+					Name="Release|x64"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1018,22 +1011,6 @@
 						UsePrecompiledHeader="1"
 					/>
 				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						UsePrecompiledHeader="1"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						UsePrecompiledHeader="1"
-					/>
-				</FileConfiguration>
 			</File>
 		</Filter>
 		<Filter
@@ -1046,10 +1023,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\DataSourceFactory.h"
-				>
-			</File>
-			<File
 				RelativePath=".\ds_guids.h"
 				>
 			</File>
@@ -1058,22 +1031,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\HTTPSocket.h"
-				>
-			</File>
-			<File
-				RelativePath=".\HTTPStreamingFileSource.h"
-				>
-			</File>
-			<File
-				RelativePath=".\ICustomSource.h"
-				>
-			</File>
-			<File
-				RelativePath=".\IFilterDataSource.h"
-				>
-			</File>
-			<File
 				RelativePath=".\IOggBaseTime.h"
 				>
 			</File>
@@ -1090,23 +1047,23 @@
 				>
 			</File>
 			<File
-				RelativePath=".\OggDemuxPacketSourceFilter.h"
+				RelativePath=".\OggDemuxFilter.h"
 				>
 			</File>
 			<File
-				RelativePath=".\OggDemuxPacketSourcePin.h"
+				RelativePath=".\OggDemuxInputPin.h"
 				>
 			</File>
 			<File
-				RelativePath=".\oggdllstuff.h"
+				RelativePath=".\OggDemuxOutputPin.h"
 				>
 			</File>
 			<File
-				RelativePath=".\OggStreamMapper.h"
+				RelativePath=".\oggdllstuff.h"
 				>
 			</File>
 			<File
-				RelativePath=".\SingleMediaFileCache.h"
+				RelativePath=".\OggStreamMapper.h"
 				>
 			</File>
 			<File
@@ -1120,14 +1077,6 @@
 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
 			>
 		</Filter>
-		<File
-			RelativePath="..\..\..\codecs\flac\filters\dsfNativeFLACSource\ReadMe.txt"
-			>
-		</File>
-		<File
-			RelativePath=".\ReadMe.txt"
-			>
-		</File>
 	</Files>
 	<Globals>
 	</Globals>

Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/stdafx.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux2/stdafx.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -40,23 +40,13 @@
 // Windows Header Files:
 #include <windows.h>
 
-#include <tchar.h>
+#include <atlbase.h>
+#include <atlcom.h>
 
-// TODO: reference additional headers your program requires here
 #include <vector>
-#include <fstream>
-#include <iostream>
-using namespace std;
-
 #include "oggdllstuff.h"
-#include "OggDemuxPacketSourceFilter.h"
-#include "OggDemuxPacketSourcePin.h"
 
 #include <Dshow.h>
 #include <Qnetwork.h>
 
 #include "common/Log.h"
-
-#include <atlbase.h>
-#include <atlcom.h>
-

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -31,6 +31,7 @@
 
 #include "stdafx.h"
 #include <libOOOgg/CircularBuffer.h>
+#undef min
 
 //Leak checked : 20041017 - OK
 CircularBuffer::CircularBuffer(unsigned long inBufferSize)
@@ -43,34 +44,29 @@
 	mBuffer = new unsigned char[inBufferSize + 1];			//Deleted in destructor.
 }
 
-CircularBuffer::~CircularBuffer(void)
+CircularBuffer::~CircularBuffer()
 {
 	delete[] mBuffer;
 }
 
-unsigned long CircularBuffer::read(unsigned char* outData, unsigned long inBytesToRead, bool inAllowShortRead) {
-
-	//Returns early. - why?
-	//TODO::: This is probably a bug?
-	if (inBytesToRead >  spaceLeft()) {
-		return 0;
-	}
-    	
+unsigned long CircularBuffer::read(unsigned char* outData, unsigned long inBytesToRead, bool inAllowShortRead) 
+{
 	unsigned long locBytesToRead =	inBytesToRead;
 	
-	if (inAllowShortRead) {
-		locBytesToRead = (inBytesToRead <= numBytesAvail())		?	inBytesToRead
-																:	numBytesAvail();
+	if (inAllowShortRead) 
+    {
+        locBytesToRead = std::min(inBytesToRead, numBytesAvail());
 	}
+    else if (inBytesToRead >  spaceLeft()) 
+    {
+        return 0;
+    }
 
-	if (locBytesToRead == 0) {
+	if (locBytesToRead == 0) 
+    {
 		return 0;
 	}
 	
-		//	(inBytesToRead <= numBytesAvail())	?	inBytesToRead
-		//											:	numBytesAvail();
-	//locBytesToRead = the lower of numBytesAvail() and inBytesToRead
-
 	bufASSERT(locBytesToRead <= mBufferSize);
 	bufASSERT(locBytesToRead <= inBytesToRead);
 	bufASSERT(locBytesToRead <= numBytesAvail());
@@ -84,12 +80,15 @@
 	unsigned long locEndDistance = (mBufferSize + 1 - mReadPtr);
 	
 	//bufASSERT(locEndDistance <= mBufferSize);
-	if (locEndDistance >= locBytesToRead) {
+	if (locEndDistance >= locBytesToRead) 
+    {
 		//Within the buffer
 		bufASSERT(mReadPtr <= mBufferSize);
 		
 		memcpy((void*)outData, (const void*)(mBuffer + mReadPtr), locBytesToRead);
-	} else {
+	} 
+    else 
+    {
 		bufASSERT(locEndDistance <= mBufferSize);
 
 		//Copy from the end of the raw buffer as much as we can into outdtata
@@ -103,8 +102,10 @@
 	return locBytesToRead;
 }
 
-unsigned long CircularBuffer::write(const unsigned char* inData, unsigned long inBytesToWrite) {
-	if (inBytesToWrite >  spaceLeft()) {
+unsigned long CircularBuffer::write(const unsigned char* inData, unsigned long inBytesToWrite) 
+{
+	if (inBytesToWrite >  spaceLeft()) 
+    {
 		return 0;
 	}
 
@@ -126,10 +127,13 @@
 	//signed long locEndOffset = locEndDistance - locBytesToWrite;
 
 
-	if (locEndDistance >= locBytesToWrite) {
+	if (locEndDistance >= locBytesToWrite) 
+    {
 		//Within the buffer
 		memcpy((void*)(mBuffer + mWritePtr), ((const void*)inData), locBytesToWrite);
-	} else {
+	} 
+    else 
+    {
 		bufASSERT(locEndDistance <= mBufferSize);
 
 		//Copy from the end of the raw buffer as much as we can into outdtata
@@ -144,18 +148,17 @@
 	mWritePtr = (mWritePtr + locBytesToWrite) % (mBufferSize + 1);
 
 	return locBytesToWrite;
-
-	
-
 }
 
-unsigned long CircularBuffer::spaceLeft() {
+unsigned long CircularBuffer::spaceLeft() 
+{
 	bufASSERT(mReadPtr <= mBufferSize);
 	bufASSERT(mWritePtr <= mBufferSize);
 
 	//The write pointer is always treated as being equal to or in front of the read pointer.
 	//return mBufferSize - numBytesAvail() - 1;
-	if (mReadPtr > mWritePtr) {
+	if (mReadPtr > mWritePtr) 
+    {
 		//Read pointer is to the right of the Write pointer
 		// Since the write pointer is always in front, this means all the data from the read ptr
 		// to the end of the buffer, plus everything from the start up to the write pointer is
@@ -165,16 +168,20 @@
 
 		bufASSERT(mReadPtr > mWritePtr);
 		return  (mReadPtr - mWritePtr - 1);
-	} else {
+	} 
+    else 
+    {
 		bufASSERT(mReadPtr <= mWritePtr);
 		return mBufferSize + mReadPtr - mWritePtr ;
 	}
 }
-unsigned long CircularBuffer::numBytesAvail() {
+unsigned long CircularBuffer::numBytesAvail() 
+{
 	bufASSERT(mReadPtr <= mBufferSize);
 	bufASSERT(mWritePtr <= mBufferSize);
 
-	if (mReadPtr > mWritePtr) {
+	if (mReadPtr > mWritePtr) 
+    {
 		//Read pointer is to the right of the Write pointer
 		// Since the write pointer is always in front, this means all the data from the read ptr
 		// to the end of the buffer, plus everything from the start up to the write pointer is
@@ -186,14 +193,16 @@
 
 		//Here
 		return  (mBufferSize + 1 + mWritePtr - mReadPtr);
-	} else {
+	} 
+    else 
+    {
 		//if (mReadPtr <= mWritePtr)
 		return mWritePtr - mReadPtr;
 	}
 }
 
-void CircularBuffer::reset() {
+void CircularBuffer::reset() 
+{
 	mWritePtr = 0;
 	mReadPtr = 0;
 }
-

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -123,8 +123,7 @@
 //
 //
 
-class LIBOOOGG_API CircularBuffer
-	:	public IFIFOBuffer
+class LIBOOOGG_API CircularBuffer:	public IFIFOBuffer
 {
 public:
 	/// Constructor taking in the size in bytes of the internal buffer.

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -32,6 +32,7 @@
 #include "stdafx.h"
 #include <libOOOgg/OggDataBuffer.h>
 #include "common/Log.h"
+#undef min
 
 //LEAK CHECKED - 2004/10/17		-	OK.
 //LEAK FOUND - 2004/11/29  -  acceptOggPage
@@ -171,23 +172,22 @@
 		if (inData != NULL) 
         {
 			//Buffer is not null and there is at least 1 byte of data.
-			
 			// LOG(logDEBUG1) << "Fed " << inNumBytes << " bytes...";
-			unsigned long locNumWritten = mBuffer->write(inData, inNumBytes);
+			unsigned long locNumWritten = 0;
 
-			if (locNumWritten < inNumBytes) 
+            eProcessResult locResult = PROCESS_OK;
+            while (locNumWritten < inNumBytes && locResult == PROCESS_OK) 
             {
-				//TODO::: What does happen in this case.
-
-				//Handle this case... you lose data.
-				//Buffer is full
-				
-				// LOG(logDEBUG1) << "Feed : Could count feed in " << inNumBytes <<" bytes";
-				// LOG(logDEBUG1) << "Feed : ** "<< mBuffer->numBytesAvail() << " avail, " << mBuffer->spaceLeft() << " space left.";
-
-				locNumWritten = locNumWritten;
-			}
-			return (eFeedResult)processBuffer();
+                unsigned long locBytesToWrite = std::min(inNumBytes - locNumWritten, mBuffer->spaceLeft());
+                unsigned long locBytesWritten = mBuffer->write(&inData[locNumWritten], locBytesToWrite);
+                if (locBytesWritten == 0)
+                {
+                    return FEED_BUFFER_WRITE_ERROR;
+                }
+                locNumWritten += locBytesWritten;
+                locResult = processBuffer();
+            }
+            return (eFeedResult)locResult;
 		} 
         else 
         {
@@ -229,8 +229,8 @@
 			//The buffer handles it for us, it won't let us read less, and will return 0
 			//	This is fine for valid files, but still needs to be reviewed.
 
-			// LOG(logDEBUG1) << "ProcessBaseHeader : ###### Read was short.";
-			// LOG(logDEBUG1) << "ProcessBaseHeader : ** "<< mBuffer->numBytesAvail() <<" avail, " << mBuffer->spaceLeft() <<" space left.";
+			LOG(logDEBUG1) << "ProcessBaseHeader : ###### Read was short.";
+			LOG(logDEBUG1) << "ProcessBaseHeader : ** "<< mBuffer->numBytesAvail() <<" avail, " << mBuffer->spaceLeft() <<" space left.";
 			locNumRead = locNumRead;
 		}
 
@@ -283,8 +283,8 @@
 	if (locNumRead < locNumSegs) 
     {
 		//TODO::: Handle this case
-		// LOG(logDEBUG1) << "ProcessSegTable : ##### Short read";
-		// LOG(logDEBUG1) << "ProcessSegTable : ** "<< mBuffer->numBytesAvail() << " avail, " << mBuffer->spaceLeft() << " space left.";		
+		LOG(logDEBUG1) << "ProcessSegTable : ##### Short read";
+		LOG(logDEBUG1) << "ProcessSegTable : ** "<< mBuffer->numBytesAvail() << " avail, " << mBuffer->spaceLeft() << " space left.";		
 	}
 
 
@@ -358,8 +358,8 @@
             {
 				//TODO::: Handle this case.
 
-				// LOG(logDEBUG1) << "ProcessDataSegment : ###### Short read";
-				// LOG(logDEBUG1) << "ProcessDataSegment : ** " << mBuffer->numBytesAvail() << " avail, " << mBuffer->spaceLeft() << " space left.";
+				LOG(logDEBUG1) << "ProcessDataSegment : ###### Short read";
+				LOG(logDEBUG1) << "ProcessDataSegment : ** " << mBuffer->numBytesAvail() << " avail, " << mBuffer->spaceLeft() << " space left.";
 				locNumRead = locNumRead;
 			}
 
@@ -506,7 +506,7 @@
 			case LOST_PAGE_SYNC:
 				//TODO::: Insert resync code here.
 
-				// LOG(logDEBUG1) << "ProcessBuffer : State = LOST_PAGE_SYNC";
+				LOG(logDEBUG1) << "ProcessBuffer : State = LOST_PAGE_SYNC";
 				return PROCESS_LOST_SYNC;
 			default:
 				//TODO::: What are we supposed to do with this. Anything need cleaning up ?

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,5 +1,7 @@
 #include "StdAfx.h"
 #include ".\autooggchaingranuleseektable.h"
+#include <limits>
+#undef max
 
 #ifdef UNICODE
 AutoOggChainGranuleSeekTable::AutoOggChainGranuleSeekTable(wstring inFilename)
@@ -55,7 +57,7 @@
 }
 OggGranuleSeekTable::tSeekPair AutoOggChainGranuleSeekTable::seekPos(LOOG_INT64 inTime)
 {
-	unsigned long retEarliestPos = 4294967295UL;
+    LOOG_INT64 retEarliestPos = std::numeric_limits<LOOG_INT64>::max();
 
 	LOOG_INT64 locStreamTime = -1;
 	bool locGotAValidPos = false;
@@ -65,7 +67,9 @@
 	OggGranuleSeekTable::tSeekPair retBestSeekInfo;
 	for (size_t i = 0; i < mStreamMaps.size(); i++) {
 
-		if ((mStreamMaps[i].mSeekTable != NULL) && (mStreamMaps[i].mSeekInterface != NULL)) {
+		if (mStreamMaps[i].mSeekTable != NULL && 
+            mStreamMaps[i].mSeekInterface != NULL) 
+        {
 			//Get the preliminary seek info
 			locSeekInfo = mStreamMaps[i].mSeekTable->getStartPos(inTime);
 			//1. Get the granule pos in the preliminary seek

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -57,8 +57,8 @@
 #else
 	string mFilename;
 #endif
-	unsigned long mFilePos;
+	LOOG_INT64 mFilePos;
 
-	unsigned long mPreviousFilePos;
+	LOOG_INT64 mPreviousFilePos;
 	OggDataBuffer* mOggDemux;
 };

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,5 +1,6 @@
 //===========================================================================
 //Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
+//Copyright (C) 2010 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -49,7 +50,7 @@
 bool OggGranuleSeekTable::enabled() {
 	return mEnabled;
 }
-bool OggGranuleSeekTable::addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos, LOOG_INT64 inGranulePos)
+bool OggGranuleSeekTable::addSeekPoint(LOOG_INT64 inTime, LOOG_INT64 mStartPos, LOOG_INT64 inGranulePos)
 {
 	//stDebug<< "Add Point :  Time = "<<inTime<<"   --   Byte Pos : "<<mStartPos<<endl;
 	tGranulePair locPair;
@@ -59,7 +60,6 @@
 	mSeekMap.insert(tSeekMap::value_type(inTime, locPair));
 
 	return true;
-
 }
 
 
@@ -73,12 +73,26 @@
 	// Finds the upper bound of the requested time in mSeekMap, which will always be in the range
 	// (0, maxItems], and return the element _before_ the upper bound
     //return *(--(mSeekMap.upper_bound(inTime)));
+    if (mSeekMap.empty())
+    {
+        tSeekPair empty;
+        tGranulePair zeroGranule;
 
+        zeroGranule.first = 0;
+        zeroGranule.second = 0;
+        empty.first = 0;
+        empty.second = zeroGranule;
 
+        return empty;
+    }
+
 	tSeekMap::iterator locIt = mSeekMap.lower_bound(inTime);
-	if (locIt == mSeekMap.begin()) {
+	if (locIt == mSeekMap.begin()) 
+    {
 		return *(locIt);
-	} else {
+	} 
+    else 
+    {
 		return *(--locIt);
 	}
 }

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -1,8 +1,6 @@
-
-
-
 //===========================================================================
 //Copyright (C) 2003, 2004 Zentaro Kavanagh
+//Copyright (C) 2010 Cristian Adam
 //
 //Redistribution and use in source and binary forms, with or without
 //modification, are permitted provided that the following conditions
@@ -49,7 +47,7 @@
 	virtual ~OggGranuleSeekTable(void);
 
 	/// A Pair consitsing of a byte position and a granule pos
-	typedef pair<unsigned long, LOOG_INT64> tGranulePair;
+	typedef pair<LOOG_INT64, LOOG_INT64> tGranulePair;
 
 	/// A pair consiting of a real time, and a granule pair, making a triplet.
 	typedef pair<LOOG_INT64, tGranulePair> tSeekPair;
@@ -59,7 +57,7 @@
 	tSeekMap getSeekMap();
 
 	/// Add a seek point (which consists of a time in DirectShow units, and a byte offset corresponding to that time, and a granule pos) to the seek table.
-	bool addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos, LOOG_INT64 inGranulePos);
+	bool addSeekPoint(LOOG_INT64 inTime, LOOG_INT64 mStartPos, LOOG_INT64 inGranulePos);
 
 	/// Given a requested seek time in DirectShow units, returns the closest time and byte to the seek time.
 	tSeekPair getStartPos(LOOG_INT64 inTime);

Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.cpp	2010-05-03 22:38:42 UTC (rev 17188)
@@ -39,7 +39,7 @@
 #include "CustomVMR9Allocator.h"
 
 namespace {
-    const GUID CLSID_OggDemuxPacketSourceFilter =
+    const GUID CLSID_OggDemuxFilter =
     {0xc9361f5a, 0x3282, 0x4944, {0x98, 0x99, 0x6d, 0x99, 0xcd, 0xc5, 0x37, 0xb}};
 
     const GUID CLSID_VorbisDecodeFilter =
@@ -70,7 +70,7 @@
     {
         CHECK_HR(m_graphBuilder.CoCreateInstance(CLSID_FilterGraph));
 
-        AddSourceFilter();
+        AddSourceDemuxFilters();
         AddDecoders();
         ConnectDecoders();
         AddRenderers();
@@ -96,13 +96,33 @@
     }
 }
 
-void FilterGraph::AddSourceFilter()
+void FilterGraph::AddSourceDemuxFilters()
 {
-    m_oggSource = DShowUtil::AddFilterFromCLSID(m_graphBuilder, CLSID_OggDemuxPacketSourceFilter, 
-                                                L"Ogg Source Filter");
+    CLSID sourceCLSID = CLSID_URLReader;
 
-    CComQIPtr<IFileSourceFilter> fileSource = m_oggSource;
+    CString lowerCaseUrl(m_videoUrl);
+    lowerCaseUrl.MakeLower();
+
+    if (lowerCaseUrl.Find(L"file://") != -1)
+    {
+        sourceCLSID = CLSID_AsyncReader;
+    }
+
+    // Add the source filter
+    m_sourceFilter = DShowUtil::AddFilterFromCLSID(m_graphBuilder, sourceCLSID, L"Source Filter");
+
+    CComQIPtr<IFileSourceFilter> fileSource = m_sourceFilter;
     CHECK_HR(fileSource->Load(m_videoUrl, 0));
+
+    // Add the ogg demux filter
+    m_oggDemux = DShowUtil::AddFilterFromCLSID(m_graphBuilder, CLSID_OggDemuxFilter, 
+        L"Ogg Demux Filter");
+
+    // Connect the source and demux filters
+    CComPtr<IPin> sourceOut = DShowUtil::FindPin(m_sourceFilter, PINDIR_OUTPUT);
+    CComPtr<IPin> oggDemuxIn = DShowUtil::FindPin(m_oggDemux, PINDIR_INPUT);
+
+    CHECK_HR(m_graphBuilder->Connect(sourceOut, oggDemuxIn));
 }
 
 void FilterGraph::AddDecoders()
@@ -119,7 +139,7 @@
 void FilterGraph::ConnectDecoders()
 {
     // Connect vorbis decoder
-    CComPtr<IPin> vorbisDemuxOut = DShowUtil::FindPin(m_oggSource, PINDIR_OUTPUT, 1);
+    CComPtr<IPin> vorbisDemuxOut = DShowUtil::FindPin(m_oggDemux, PINDIR_OUTPUT, 1);
     CComPtr<IPin> vorbisDecoderIn = DShowUtil::FindPin(m_vorbisDecoder, PINDIR_INPUT, 0);
 
     if (vorbisDemuxOut)
@@ -132,7 +152,7 @@
     }
 
     // Connect theora decoder
-    CComPtr<IPin> theoraDemuxOut = DShowUtil::FindPin(m_oggSource, PINDIR_OUTPUT, 0);
+    CComPtr<IPin> theoraDemuxOut = DShowUtil::FindPin(m_oggDemux, PINDIR_OUTPUT, 0);
     CComPtr<IPin> theoraDecoderIn = DShowUtil::FindPin(m_theoraDecoder, PINDIR_INPUT, 0);
 
     if (theoraDemuxOut)

Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h	2010-05-01 05:20:57 UTC (rev 17187)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/FilterGraph.h	2010-05-03 22:38:42 UTC (rev 17188)
@@ -69,7 +69,7 @@
     long GetMovieEventCode();
 
 private:
-    void AddSourceFilter();
+    void AddSourceDemuxFilters();
     void AddDecoders();
     void ConnectDecoders();
     void AddRenderers();
@@ -81,7 +81,8 @@
 
     CComPtr<IFilterGraph2> m_graphBuilder;
     
-    CComPtr<IBaseFilter> m_oggSource;
+    CComPtr<IBaseFilter> m_sourceFilter;
+    CComPtr<IBaseFilter> m_oggDemux;
     CComPtr<IBaseFilter> m_vorbisDecoder;
     CComPtr<IBaseFilter> m_theoraDecoder;
 



More information about the commits mailing list