[xiph-commits] r8670 - in trunk/oggdsf: sln/oggdsf_all src/lib/codecs/cmml/libCMMLTags src/lib/codecs/cmml/libWinCMMLParse src/lib/helper/libOOOggChef src/lib/helper/libTemporalURI src/tests src/tests/testCMMLParser src/tests/testOOOggChef src/tools/mod_oggchef

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Fri Jan 7 20:07:50 PST 2005


Author: ozone
Date: 2005-01-07 20:07:50 -0800 (Fri, 07 Jan 2005)
New Revision: 8670

Added:
   trunk/oggdsf/src/tests/testOOOggChef/
   trunk/oggdsf/src/tests/testOOOggChef/ReadMe.txt
   trunk/oggdsf/src/tests/testOOOggChef/stdafx.cpp
   trunk/oggdsf/src/tests/testOOOggChef/stdafx.h
   trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.cpp
   trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.vcproj
Modified:
   trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
   trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.vcproj
   trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.vcproj
   trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
   trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
   trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp
   trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.h
   trunk/oggdsf/src/lib/helper/libOOOggChef/IRecomposer.h
   trunk/oggdsf/src/lib/helper/libOOOggChef/libOOOggChef.vcproj
   trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
   trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.h
   trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.vcproj
   trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
Log:
oggdsf:
 * Added testOOOggChef test
 * Added getClipsFrom() method to libCMMLTags/C_ClipTagList class
 * IRecomposer::recomposeStreamFrom now returns bool to indicate success, rather than void
 * Overloaded C_TimeStamp's parseTimeStamp() method, so it can parse doubles as well as strings
 * CMMLRecomposer (and thus mod_oggchef) can now recompose CMML starting at a certain time offset
 * mod_oggchef now returns a HTTP 500 error if recomposition dies in the arse
 * Fixed memory leak in AnnodexRecomposer class


Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2005-01-08 04:07:50 UTC (rev 8670)
@@ -837,6 +837,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCMMLTags", "..\..\src\lib\codecs\cmml\libCMMLTags\libCMMLTags.vcproj", "{AD38DCC6-B431-4B32-8569-74F3376EF2DA}"
 	ProjectSection(ProjectDependencies) = postProject
+		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
+		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsfSubtitleVMR9", "..\..\src\lib\core\directshow\dsfSubtitleVMR9\dsfSubtitleVMR9.vcproj", "{88532BA9-1EED-421F-84BF-88A7A87FB2D3}"
@@ -1126,7 +1128,10 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libOOOggChef", "..\..\src\lib\helper\libOOOggChef\libOOOggChef.vcproj", "{3D55194E-6732-4A74-A947-EDFF585A0F19}"
 	ProjectSection(ProjectDependencies) = postProject
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
+		{37CA269C-45DF-4DF7-9C12-3FE3B651D6FC} = {37CA269C-45DF-4DF7-9C12-3FE3B651D6FC}
 		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
+		{AD38DCC6-B431-4B32-8569-74F3376EF2DA} = {AD38DCC6-B431-4B32-8569-74F3376EF2DA}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject
@@ -1151,6 +1156,15 @@
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testOOOggChef", "..\..\src\tests\testOOOggChef\testOOOggChef.vcproj", "{1D3F3520-FD46-4C72-B2AA-A917AB368053}"
+	ProjectSection(ProjectDependencies) = postProject
+		{3D55194E-6732-4A74-A947-EDFF585A0F19} = {3D55194E-6732-4A74-A947-EDFF585A0F19}
+		{23BAAF7B-AEC3-4812-AA91-7E5061E83A39} = {23BAAF7B-AEC3-4812-AA91-7E5061E83A39}
+		{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
 Global
 	GlobalSection(SolutionConfiguration) = preSolution
 		Debug = Debug
@@ -2580,6 +2594,26 @@
 		{463B5ED7-C6A3-4343-BA67-B324580BEC70}.Release_SSE.Build.0 = Release|Win32
 		{463B5ED7-C6A3-4343-BA67-B324580BEC70}.Release_SSE2.ActiveCfg = Release|Win32
 		{463B5ED7-C6A3-4343-BA67-B324580BEC70}.Release_SSE2.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug.ActiveCfg = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug.Build.0 = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug Unicode.ActiveCfg = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug Unicode.Build.0 = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug__cdecl.ActiveCfg = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Debug__cdecl.Build.0 = Debug|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.MakeFile.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.MakeFile.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release Unicode.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release Unicode.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release__cdecl.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release__cdecl.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_NoDotNET.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_NoDotNET.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_SSE.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_SSE.Build.0 = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_SSE2.ActiveCfg = Release|Win32
+		{1D3F3520-FD46-4C72-B2AA-A917AB368053}.Release_SSE2.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionItems) = postSolution
 	EndGlobalSection

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -32,8 +32,15 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 #include "stdafx.h"
-#include ".\c_cliptaglist.h"
 
+#include <libCMMLTags/C_ClipTagList.h>
+#include <libilliCore/StringHelper.h>
+#include <libTemporalURI/C_TimeStamp.h>
+
+#include <fstream>
+
+#include <assert.h>
+
 C_ClipTagList::C_ClipTagList(void)
 {
 }
@@ -70,4 +77,55 @@
 	C_ClipTagList* retList = new C_ClipTagList;
 	privateClone(retList);
 	return retList;
-}
\ No newline at end of file
+}
+
+/** Note that the returned C_ClipTagList must be deleted by you.
+  */
+C_ClipTagList *C_ClipTagList::getClipsFrom(LOOG_INT64 inTimeInDirectShowUnits)
+{
+	C_ClipTagList *locClipTagList = new C_ClipTagList;
+
+	bool locAlreadyEncounteredClipInTimeRange = false;
+
+	for (unsigned long i = 0; i < numTags(); i++) {
+		C_ClipTag *locTag = getTag(i);
+		
+		// Convert the time stamp from a string to time in DirectSeconds(TM)
+		wstring locStart = locTag->start();
+		C_TimeStamp locTimeStamp;
+		if (!locTimeStamp.parseTimeStamp(StringHelper::toNarrowStr(locStart))) {
+			// Mmm, couldn't parse the time stamp for this clip ... so, err,
+			// let's just skip it.  Yeah, that's a grreeeeat idea ...
+			continue;
+		}
+		LOOG_INT64 locStartTime = locTimeStamp.toHunNanos();
+
+		if (locStartTime >= inTimeInDirectShowUnits) {
+			if (!locAlreadyEncounteredClipInTimeRange) {
+				// Only add the previous clip to the clip list if its end time
+				// is beyond the requested time
+				{
+					wstring locEnd = locTag->end();
+					C_TimeStamp locEndTimeStamp;
+					if (locEndTimeStamp.parseTimeStamp(StringHelper::toNarrowStr(locEnd))) {
+						// Clip has an end time: check if it's before the requested time
+						LOOG_INT64 locEndTime = locEndTimeStamp.toHunNanos();
+						if (locEndTime < inTimeInDirectShowUnits) {
+							continue;
+						}
+					}
+				}
+
+				// If we're not the very first clip ...
+				if (i > 0) {
+					C_ClipTag *locClipInTimeRange = getTag(i - 1);
+					locClipTagList->addTag(locClipInTimeRange->clone());
+				}
+				locAlreadyEncounteredClipInTimeRange = true;
+			}
+			locClipTagList->addTag(locTag->clone());
+		}
+	}
+
+	return locClipTagList;
+}

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -37,6 +37,8 @@
 #include <string>
 using namespace std;
 
+#include <libilliCore/illicoreconfig.h>
+
 //Local Include Files
 #include <libCMMLTags/C_TagList.h>
 #include <libCMMLTags/C_ClipTag.h>
@@ -58,5 +60,8 @@
 	void addTag(C_ClipTag* inTag);
 	C_ClipTag* getTag(unsigned long inTagNo);
 
+	/// Returns a new C_ClipTagList, which contains clips occuring during or after the time given via inTimeInDirectShowUnits
+	C_ClipTagList *getClipsFrom(LOOG_INT64 inTimeInDirectShowUnits);
+
 	virtual void privateClone(C_TagList* outTagList);
 };

Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.vcproj
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.vcproj	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.vcproj	2005-01-08 04:07:50 UTC (rev 8670)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -77,7 +77,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -137,7 +137,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -198,7 +198,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -252,7 +252,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -310,7 +310,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..;..\..\..\helper"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCMMLTAGS_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"

Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.vcproj
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.vcproj	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.vcproj	2005-01-08 04:07:50 UTC (rev 8670)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..\..\..\helper;.."
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBWINCMMLPARSE_EXPORTS"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -78,7 +78,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..\..\..\helper;.."
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBWINCMMLPARSE_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -139,7 +139,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..\..\..\helper;.."
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBWINCMMLPARSE_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
@@ -201,7 +201,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="TRUE"
 				OptimizeForProcessor="3"
-				AdditionalIncludeDirectories=".."
+				AdditionalIncludeDirectories="..\..\..\helper;.."
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBWINCMMLPARSE_EXPORTS"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -81,7 +81,7 @@
     is a vector of strings, which will be matched against the MIME type in the
 	AnxData header of the logical bitstream.
   */
-void AnnodexRecomposer::recomposeStreamFrom(double inStartingTimeOffset,
+bool AnnodexRecomposer::recomposeStreamFrom(double inStartingTimeOffset,
 	const vector<string>* inWantedMIMETypes)
 {
 	mWantedMIMETypes = inWantedMIMETypes;
@@ -212,6 +212,7 @@
 	mDebugFile.close();
 #endif
 
+	return true;
 }
 
 bool isAnnodexBOSPage (OggPage *inOggPage)
@@ -290,8 +291,10 @@
 
 					if (!wantOnlyPacketBody(mWantedMIMETypes)) {
 						// Send out the page
-						mBufferWriter(inOggPage->createRawPageData(),
+						unsigned char *locRawPageData = inOggPage->createRawPageData();
+						mBufferWriter(locRawPageData,
 							inOggPage->pageSize(), mBufferWriterUserData);
+						delete locRawPageData;
 					}
 				} else {
 					// The Annodex BOS page should always be the very first page of
@@ -319,16 +322,20 @@
 							mWantedStreamSerialNumbers.push_back(locMap);
 
 							if (!wantOnlyPacketBody(mWantedMIMETypes)) {
-								mBufferWriter(inOggPage->createRawPageData(),
+								unsigned char *locRawPageData = inOggPage->createRawPageData();
+								mBufferWriter(locRawPageData,
 									inOggPage->pageSize(), mBufferWriterUserData);
+								delete locRawPageData;
 							}
 						}
 					}
 				} else if (isAnnodexEOSPage(inOggPage, mAnnodexSerialNumber)) {
 					mDemuxState = SEEN_ANNODEX_EOS;
 					if (!wantOnlyPacketBody(mWantedMIMETypes)) {
-						mBufferWriter(inOggPage->createRawPageData(),
+						unsigned char *locRawPageData = inOggPage->createRawPageData();
+						mBufferWriter(locRawPageData,
 							inOggPage->pageSize(), mBufferWriterUserData);
+						delete locRawPageData;
 					}
 				} else {
 					// We didn't spot either an AnxData page or the Annodex EOS: WTF?
@@ -349,8 +356,10 @@
 									mBufferWriter(locPacket->packetData(),
 										locPacket->packetSize(), mBufferWriterUserData);
 								} else {
-									mBufferWriter(inOggPage->createRawPageData(),
+									unsigned char *locRawPageData = inOggPage->createRawPageData();
+									mBufferWriter(locRawPageData,
 										inOggPage->pageSize(), mBufferWriterUserData);
+									delete locRawPageData;
 								}
 							} 
 #if 0
@@ -457,8 +466,10 @@
 									}
 								}
 							} else {
-								mBufferWriter(inOggPage->createRawPageData(),
+								unsigned char *locRawPageData = inOggPage->createRawPageData();								
+								mBufferWriter(locRawPageData,
 									inOggPage->pageSize(), mBufferWriterUserData);
+								delete locRawPageData;
 							}
 						}
 					}

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/AnnodexRecomposer.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -52,7 +52,7 @@
 	AnnodexRecomposer(string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData, const string inCachedSeekTableFilename = "");
 	~AnnodexRecomposer(void);
 
-	void recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes);
+	bool recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes);
 	bool acceptOggPage(OggPage* inOggPage);
 
     AnnodexRecomposer(const AnnodexRecomposer&);  // Don't copy me

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -38,7 +38,11 @@
 #include <libOOOggChef/CMMLRecomposer.h>
 #include <libOOOggChef/utils.h>
 
+#include <libilliCore/StringHelper.h>
 #include <libOOOgg/libOOOgg.h>
+#include <libCMMLTags/libCMMLTags.h>
+#include <libTemporalURI/C_TimeStamp.h>
+#include <libWinCMMLParse/CMMLParser.h>
 
 #include <assert.h>
 
@@ -49,8 +53,10 @@
 
 using namespace std;
 
+#undef DEBUG
+
 CMMLRecomposer::CMMLRecomposer(string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData)
-	:	mFilename(inFilename)
+	:	mCMMLFilename(inFilename)
 	,	mBufferWriter(inBufferWriter)
 	,	mBufferWriterUserData(inBufferWriterUserData)
 {
@@ -62,18 +68,116 @@
 }
 
 	
-void CMMLRecomposer::recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes)
+bool CMMLRecomposer::recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes)
 {
-	// If the only wants only CMML, well, just serve out the CMML
-	if (wantOnlyCMML(inWantedMIMETypes)) {
-		sendFile(mFilename, mBufferWriter, mBufferWriterUserData);
-	} else {
-		// TODO: Implement other output types :)
-		const char *locCrapx0r = "NOT IMPLEMENTED YET\r\n";
-		mBufferWriter((unsigned char *) locCrapx0r,
-			(unsigned long) strlen(locCrapx0r),
-			mBufferWriterUserData);
+	// If the only wants just zee basic CMML, well, just serve out the CMML
+	if (wantOnlyCMML(inWantedMIMETypes) && inStartingTimeOffset == 0) {
+		sendFile(mCMMLFilename, mBufferWriter, mBufferWriterUserData);
+		return true;
 	}
+
+#ifdef DEBUG
+	mDebugFile.open("G:\\Logs\\CMMLRecomposer.log", ios_base::out);
+	mDebugFile << "CMMLRecomposer 1 " << endl;
+#endif
+
+	// Parse in the CMML into a C_CMMLDoc class
+	C_CMMLDoc *locCMML = new C_CMMLDoc;
+	CMMLParser locCMMLParser;
+	locCMMLParser.parseDocFromFile(StringHelper::toWStr(mCMMLFilename), locCMML);
+
+	// We assume that CMML recomposition fails unless explicitly set otherwise
+	bool locReturnValue = false;
+
+	// We need to declare and initialise all our variables here, because
+	// in the presence of errors, we may be deleting variables which haven't
+	// been initialised yet ...
+	C_CMMLRootTag *locCMMLRoot = NULL;
+	C_StreamTag *locStream = NULL;
+
+	if (locCMML == NULL) {
+		goto cleanup;
+	}
+
+	// No matter what the output type is, we always have to read & parse the stream
+	// and head tags anyway, so do that now
+
+	// If we don't have a root tag at all, we're pretty screwed: fail with prejudice
+	locCMMLRoot = locCMML->root();
+	if (locCMMLRoot == NULL) {
+		goto cleanup;
+	}
+
+	// It's not catastrophic if we don't have <stream>, <head>, or even <clip> tags
+	locStream = locCMMLRoot->stream();
+#if 0
+	C_HeadTag *locHead = locCMMLRoot->head();
+	C_ClipTagList *locClipList = locCMMLRoot->clipList();
+#endif
+
+	// If our final output type is CMML, we deal with it (otherwise we hand off the
+	// recomposition to AnnodexRecomposer -- see below)
+
+	// XXX: Checking for * / * is a pretty dodgy hack ...
+	if (wantOnlyCMML(inWantedMIMETypes) || inWantedMIMETypes->at(0) == "*/*") {
+		C_CMMLDoc* locCMMLDoc = locCMML->clone();
+
+		// If the clip list exists ...
+		if (locCMMLDoc && locCMMLDoc->root() && locCMMLDoc->root()->clipList()) {
+			// ... we need to replace it with only the clips during or after
+			// the user's requested time
+
+#ifdef DEBUG
+			mDebugFile << "Got here 1" << endl;
+#endif
+
+			// Convert the requested time from a double to an int64
+			C_TimeStamp locTimeStamp;
+			locTimeStamp.parseTimeStamp(inStartingTimeOffset);
+			LOOG_INT64 locTime = locTimeStamp.toHunNanos();
+
+#ifdef DEBUG
+			mDebugFile << "locTime: " << locTime << endl;
+#endif
+
+			// Get the clip tags during or after the wanted time
+			C_ClipTagList *locRequestedClips =
+				locCMMLDoc->root()->clipList()->getClipsFrom(locTime);
+
+			// Replace the clip list in our new CMML document.  We don't need to
+			// delete the old clip list before doing this, since the setClipList()
+			// method takes care of that for us.
+			locCMMLDoc->root()->setClipList(locRequestedClips);
+		}
+
+		// Pump out the newly created CMML document
+		string locCMMLDocString =
+			StringHelper::toNarrowStr(locCMMLDoc->toString());
+		mBufferWriter((unsigned char *) locCMMLDocString.c_str(),
+			(unsigned long) locCMMLDocString.size(), mBufferWriterUserData);
+
+		// Indicate success to our callee
+		locReturnValue = true;
+	}
+
+#if 0
+	C_ImportTagList *locImportTagList = locStream->importList();
+	if (locImportTagList == NULL) {
+		goto cleanup;
+	}
+#endif
+
+cleanup:
+	if (locCMML) {
+		delete locCMML;
+		locCMML = NULL;
+	}
+
+#ifdef DEBUG
+	mDebugFile.close();
+#endif
+
+	return locReturnValue;
 }
 
 

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/CMMLRecomposer.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -49,10 +49,10 @@
 {
 public:
 	CMMLRecomposer(void);
-	CMMLRecomposer(string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData);
+	CMMLRecomposer(string inCMMLFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData);
 	~CMMLRecomposer(void);
 
-	void recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes);
+	bool recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes);
 	bool acceptOggPage(OggPage* inOggPage);
 
     CMMLRecomposer(const CMMLRecomposer&);  // Don't copy me
@@ -65,7 +65,7 @@
 
 	fstream mDebugFile;
 
-	string mFilename;
+	string mCMMLFilename;
 
 	const vector<string>* mWantedMIMETypes;
 };

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/IRecomposer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/IRecomposer.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/IRecomposer.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -50,6 +50,6 @@
 	virtual ~IRecomposer(void);
 
 	/// Recompose a stream from a particular time offset and/or only selecting certain logical bitstreams (specified as MIME types)
-	virtual void recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes) = 0;
+	virtual bool recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes) = 0;
 };
 

Modified: trunk/oggdsf/src/lib/helper/libOOOggChef/libOOOggChef.vcproj
===================================================================
--- trunk/oggdsf/src/lib/helper/libOOOggChef/libOOOggChef.vcproj	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libOOOggChef/libOOOggChef.vcproj	2005-01-08 04:07:50 UTC (rev 8670)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\core\ogg;.."
+				AdditionalIncludeDirectories="..\..\codecs\cmml;..\..\core\ogg;.."
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOOOGGCHEF_EXPORTS"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -68,7 +68,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\core\ogg;.."
+				AdditionalIncludeDirectories="..\..\codecs\cmml;..\..\core\ogg;.."
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBOOOGGCHEF_EXPORTS"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="3"

Modified: trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -202,6 +202,21 @@
 	};
 }
 
+bool C_TimeStamp::parseTimeStamp(double inTimeStampInSeconds)
+{
+	char *locTimeCString = new char[64];
+	if (sprintf(locTimeCString, "%lf", inTimeStampInSeconds) < 0) {
+		delete [] locTimeCString;
+		return false;
+	}
+
+	bool locReturnValue = parseTimeStamp(locTimeCString);
+
+	delete [] locTimeCString;
+
+	return locReturnValue;
+}
+
 bool C_TimeStamp::parseTimeStamp(string inTimeStamp)
 {
 	try {

Modified: trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -26,6 +26,7 @@
 		short seconds;
 		LOOG_UINT64 partials;
 	};
+	bool parseTimeStamp(double inTimeStampInSeconds);
 	bool parseTimeStamp(string inTimeStamp);
 
 	string toString();

Modified: trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.vcproj
===================================================================
--- trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.vcproj	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.vcproj	2005-01-08 04:07:50 UTC (rev 8670)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\lib\codecs\cmml;..\..\lib\codecs\cmml"
+				AdditionalIncludeDirectories="..\..\lib\codecs\cmml;..\..\lib\helper"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -68,7 +68,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\lib\codecs\cmml;..\..\lib\codecs\cmml"
+				AdditionalIncludeDirectories="..\..\lib\codecs\cmml;..\..\lib\helper"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="3"

Added: trunk/oggdsf/src/tests/testOOOggChef/ReadMe.txt
===================================================================
--- trunk/oggdsf/src/tests/testOOOggChef/ReadMe.txt	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testOOOggChef/ReadMe.txt	2005-01-08 04:07:50 UTC (rev 8670)
@@ -0,0 +1,32 @@
+========================================================================
+    CONSOLE APPLICATION : testOOOggChef Project Overview
+========================================================================
+
+AppWizard has created this testOOOggChef application for you.  
+This file contains a summary of what you will find in each of the files that
+make up your testOOOggChef application.
+
+
+testOOOggChef.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.
+
+testOOOggChef.cpp
+    This is the main application source file.
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+    These files are used to build a precompiled header (PCH) file
+    named testOOOggChef.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.
+
+/////////////////////////////////////////////////////////////////////////////


Property changes on: trunk/oggdsf/src/tests/testOOOggChef/ReadMe.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/tests/testOOOggChef/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testOOOggChef/stdafx.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testOOOggChef/stdafx.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// testOOOggChef.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file


Property changes on: trunk/oggdsf/src/tests/testOOOggChef/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/tests/testOOOggChef/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testOOOggChef/stdafx.h	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testOOOggChef/stdafx.h	2005-01-08 04:07:50 UTC (rev 8670)
@@ -0,0 +1,12 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here


Property changes on: trunk/oggdsf/src/tests/testOOOggChef/stdafx.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.cpp
===================================================================
--- trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -0,0 +1,48 @@
+// testOOOggChef.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include <libCMMLTags/libCMMLTags.h>
+#include <libilliCore/illicoreconfig.h>
+#include <libilliCore/StringHelper.h>
+#include <libTemporalURI/C_TimeStamp.h>
+#include <libWinCMMLParse/CMMLParser.h>
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+	C_CMMLDoc *locCMMLDoc = new C_CMMLDoc;
+
+	// Parse the document first
+
+	CMMLParser locCMMLParser;
+	string locFilename = argv[1];
+	if (!locCMMLParser.parseDocFromFile(StringHelper::toWStr(locFilename), locCMMLDoc)) {
+		cerr << "parseDocFromFile failed" << endl;
+		return 1;
+	}
+
+	// Convert the user's time specification to an int64
+
+	C_TimeStamp locTimeStamp;
+	string locTimeString = argv[2];
+	LOOG_INT64 locTime = locTimeStamp.parseTimeStamp(locTimeString);
+	cout << "Time in DirectSeconds: " << locTime << endl;
+
+	locTime = 150000000;
+
+	// Reconstruct the CMML document from the given time offset
+
+	// n.b. No error checking done to see whether the <cmml> and <clip> tags exist, so
+	// make sure they exist in the given CMML file!
+	C_ClipTagList *locClipTagList = locCMMLDoc->root()->clipList()->getClipsFrom(locTime);
+	
+	locCMMLDoc->root()->setClipList(locClipTagList);
+	string locCMMLDocString = StringHelper::toNarrowStr(locCMMLDoc->toString());
+	cout << locCMMLDocString << endl;
+
+	delete locCMMLDoc;
+
+	return 0;
+}
+


Property changes on: trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.cpp
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.vcproj
===================================================================
--- trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.vcproj	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tests/testOOOggChef/testOOOggChef.vcproj	2005-01-08 04:07:50 UTC (rev 8670)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="testOOOggChef"
+	ProjectGUID="{1D3F3520-FD46-4C72-B2AA-A917AB368053}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\src\lib\helper;..\..\..\src\lib\codecs\cmml"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"
+				CallingConvention="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/testOOOggChef.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/testOOOggChef.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\src\lib\helper;..\..\..\src\lib\codecs\cmml"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"
+				CallingConvention="2"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/testOOOggChef.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</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=".\stdafx.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\testOOOggChef.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<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>
+		<File
+			RelativePath=".\ReadMe.txt">
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Modified: trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp
===================================================================
--- trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp	2005-01-08 03:18:36 UTC (rev 8669)
+++ trunk/oggdsf/src/tools/mod_oggchef/mod_oggchef.cpp	2005-01-08 04:07:50 UTC (rev 8670)
@@ -122,6 +122,9 @@
 				&& (	get_accept_quality(inRequest, "application/ogg")   == 1.0
 					||	get_accept_quality(inRequest, "application/x-ogg") == 1.0)
 			)
+		||	(		isCMMLFile(locFilename)
+				&& (	get_accept_quality(inRequest, "text/x-cmml")   == 1.0)
+			)
 		)
 	{
 		vector<string>* locAcceptAllMimeTypes = new vector<string>;
@@ -224,7 +227,16 @@
 	}
 
 	if (locRecomposer) {
-		locRecomposer->recomposeStreamFrom(locRequestedStartTime, locOutputMIMETypes);
+		bool locRecompositionWasSuccessful = 
+			locRecomposer->recomposeStreamFrom(locRequestedStartTime, locOutputMIMETypes);
+		if (!locRecompositionWasSuccessful) {
+			// TODO: This really isn't the most ideal error handling, but what the hey ...
+			delete locRecomposer;
+			delete locOutputMIMETypes;
+			
+			// XXX: Is this a legal return value for this function?
+			return HTTP_INTERNAL_SERVER_ERROR;
+		}
 		delete locRecomposer;
 	}
 



More information about the commits mailing list