[xiph-commits] r8524 - in trunk/oggdsf: docs/doxygen sln/oggdsf_all src/lib/codecs/flac/libs/libflac/include/FLAC src/lib/codecs/flac/libs/libflac/src/libFLAC src/lib/core/directshow/dsfAnxDemux src/lib/core/ogg/libOOOggSeek src/tools/AnxCutter

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Wed Dec 22 20:03:49 PST 2004


Author: ozone
Date: 2004-12-22 20:03:48 -0800 (Wed, 22 Dec 2004)
New Revision: 8524

Removed:
   trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h
Modified:
   trunk/oggdsf/docs/doxygen/oggdsf.doxy
   trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
   trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/
   trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/libFLAC_dynamic.vcproj
   trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
   trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
   trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp
   trunk/oggdsf/src/tools/AnxCutter/AnxCutter.vcproj
Log:
oggdsf:

 * Warning fixes: a few down, about 10000 to go ...
 * Portability fixes
 * Remove, ignore, and fix dependency on ordinals.h from the FLAC build tree (since it's an automatically generated file)
 * AnxCutter:
   * Don't require keystroke from stdin before starting
   * Copy data from requested time offset to output stream
 * Adjusted Doxygen settings to use relative directory paths instead of absolute paths
 * No longer lose the keyframe at the start of a Theora stream
 * OggSeekTable's getStartPos now works properly



Modified: trunk/oggdsf/docs/doxygen/oggdsf.doxy
===================================================================
--- trunk/oggdsf/docs/doxygen/oggdsf.doxy	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/docs/doxygen/oggdsf.doxy	2004-12-23 04:03:48 UTC (rev 8524)
@@ -1,12 +1,12 @@
-# Doxyfile 1.3.9
+# Doxyfile 1.3.9.1
 
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = oggdsf
 PROJECT_NUMBER         = 0.68.8333
-OUTPUT_DIRECTORY       = G:/Dev/oggdsf/docs/doxygen
-CREATE_SUBDIRS         = NO
+OUTPUT_DIRECTORY       = .
+CREATE_SUBDIRS         = YES
 OUTPUT_LANGUAGE        = English
 USE_WINDOWS_ENCODING   = YES
 BRIEF_MEMBER_DESC      = YES
@@ -30,7 +30,7 @@
 STRIP_FROM_INC_PATH    = 
 SHORT_NAMES            = NO
 JAVADOC_AUTOBRIEF      = NO
-MULTILINE_CPP_IS_BRIEF = NO
+MULTILINE_CPP_IS_BRIEF = YES
 DETAILS_AT_TOP         = NO
 INHERIT_DOCS           = YES
 DISTRIBUTE_GROUP_DOC   = NO
@@ -72,14 +72,14 @@
 #---------------------------------------------------------------------------
 QUIET                  = NO
 WARNINGS               = YES
-WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_UNDOCUMENTED   = NO
 WARN_IF_DOC_ERROR      = YES
 WARN_FORMAT            = "$file:$line: $text"
 WARN_LOGFILE           = 
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = G:/Dev/oggdsf/src
+INPUT                  = ../../src
 FILE_PATTERNS          = *.c \
                          *.cc \
                          *.cxx \
@@ -128,11 +128,11 @@
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
-SOURCE_BROWSER         = NO
+SOURCE_BROWSER         = YES
 INLINE_SOURCES         = NO
 STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION    = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
 VERBATIM_HEADERS       = NO
 #---------------------------------------------------------------------------
 # configuration options related to the alphabetical class index
@@ -233,18 +233,18 @@
 #---------------------------------------------------------------------------
 # Configuration options related to the dot tool   
 #---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = NO
+CLASS_DIAGRAMS         = YES
 HIDE_UNDOC_RELATIONS   = YES
 HAVE_DOT               = YES
 CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = NO
+COLLABORATION_GRAPH    = YES
 UML_LOOK               = YES
-TEMPLATE_RELATIONS     = NO
+TEMPLATE_RELATIONS     = YES
 INCLUDE_GRAPH          = YES
 INCLUDED_BY_GRAPH      = YES
-CALL_GRAPH             = NO
+CALL_GRAPH             = YES
 GRAPHICAL_HIERARCHY    = YES
-DOT_IMAGE_FORMAT       = jpg
+DOT_IMAGE_FORMAT       = png
 DOT_PATH               = "C:/Program Files/ATT/Graphviz/bin"
 DOTFILE_DIRS           = 
 MAX_DOT_GRAPH_WIDTH    = 1024
@@ -255,4 +255,4 @@
 #---------------------------------------------------------------------------
 # Configuration::additions related to the search engine   
 #---------------------------------------------------------------------------
-SEARCHENGINE           = NO
+SEARCHENGINE           = YES

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-12-23 04:03:48 UTC (rev 8524)
@@ -1163,6 +1163,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libFLACHelper", "..\..\src\lib\codecs\flac\libs\libFLACHelper\libFLACHelper.vcproj", "{7F213248-16F2-4AAE-B941-C402670082BC}"
 	ProjectSection(ProjectDependencies) = postProject
+		{A0004AEB-B47C-4A0A-8FE7-4F65B5FD48FA} = {A0004AEB-B47C-4A0A-8FE7-4F65B5FD48FA}
 	EndProjectSection
 EndProject
 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "DotNETOggTools", "..\..\build\DotNETOggTools\DotNETOggTools.vdproj", "{16474157-607B-483C-8C31-2EB9ED724AD1}"
@@ -1196,26 +1197,38 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DecodeDirac", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\DecodeDirac\DecodeDirac.vcproj", "{CCA690F8-1356-4BD5-9152-8E0A6496842D}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracCommon", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\DiracCommon\DiracCommon.vcproj", "{A45B7D48-9E8D-4475-BED4-CBE3E3CCAD21}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracDecoder", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\DiracDecoder\DiracDecoder.vcproj", "{89EC2AEB-8284-4213-874B-29D549893FC9}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracEncoder", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\DiracEncoder\DiracEncoder.vcproj", "{9076B578-583A-493D-96C4-776DCEC0FFBD}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiracMotionEst", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\DiracMotionEst\DiracMotionEst.vcproj", "{C6A615BF-D4EB-4D50-9638-2C715E0695C6}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EncodeDirac", "..\..\src\lib\codecs\dirac\lib\libdirac\windows\VS2003\EncodeDirac\EncodeDirac.vcproj", "{547FE1E9-70EF-48D4-B45B-2FF39B39855D}"
 	ProjectSection(ProjectDependencies) = postProject
 	EndProjectSection
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libDirectshowAbstracts", "..\..\src\lib\core\directshow\libDirectshowAbstracts\libDirectshowAbstracts.vcproj", "{EA7091BB-9906-41DF-9738-F4858A136086}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -1251,6 +1264,7 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AnxCutter", "..\..\src\tools\AnxCutter\AnxCutter.vcproj", "{D50F8622-3E33-4EFC-8961-0FB7641F884B}"
 	ProjectSection(ProjectDependencies) = postProject
 		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
+		{9A14F6AC-BC6E-401A-A300-07369BD6C5FE} = {9A14F6AC-BC6E-401A-A300-07369BD6C5FE}
 		{2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4} = {2DA569EC-3E22-4BC9-A242-C7A56EB9C6F4}
 	EndProjectSection
 EndProject


Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC
___________________________________________________________________
Name: svn:ignore
   + ordinals.h


Deleted: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -1,74 +0,0 @@
-/* libFLAC - Free Lossless Audio Codec library
- * Copyright (C) 2000,2001,2002,2003,2004  Josh Coalson
- *
- * 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 the Xiph.org Foundation nor the names of its
- * 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 FOUNDATION 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.
- */
-
-#ifndef FLAC__ORDINALS_H
-#define FLAC__ORDINALS_H
-
-#ifndef _MSC_VER
-#include <inttypes.h>
-#endif
-
-typedef signed char FLAC__int8;
-typedef unsigned char FLAC__uint8;
-
-#if defined _MSC_VER
-typedef __int16 FLAC__int16;
-typedef __int32 FLAC__int32;
-typedef __int64 FLAC__int64;
-typedef unsigned __int16 FLAC__uint16;
-typedef unsigned __int32 FLAC__uint32;
-typedef unsigned __int64 FLAC__uint64;
-#else
-typedef int16_t FLAC__int16;
-typedef int32_t FLAC__int32;
-typedef int64_t FLAC__int64;
-typedef uint16_t FLAC__uint16;
-typedef uint32_t FLAC__uint32;
-typedef uint64_t FLAC__uint64;
-#endif
-
-typedef int FLAC__bool;
-
-typedef FLAC__uint8 FLAC__byte;
-typedef float FLAC__real;
-
-#ifdef true
-#undef true
-#endif
-#ifdef false
-#undef false
-#endif
-#ifndef __cplusplus
-#define true 1
-#define false 0
-#endif
-
-#endif

Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/libFLAC_dynamic.vcproj
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/libFLAC_dynamic.vcproj	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/libFLAC_dynamic.vcproj	2004-12-23 04:03:48 UTC (rev 8524)
@@ -495,15 +495,39 @@
 			</File>
 			<File
 				RelativePath=".\include\private\bitbuffer.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\bitmath.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\cpu.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\crc.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\fixed.h">
@@ -516,9 +540,21 @@
 			</File>
 			<File
 				RelativePath=".\include\private\md5.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\memory.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\include\private\metadata.h">
@@ -557,6 +593,12 @@
 			Filter="">
 			<File
 				RelativePath="..\..\include\FLAC\all.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\include\FLAC\assert.h">
@@ -572,6 +614,12 @@
 			</File>
 			<File
 				RelativePath="..\..\include\FLAC\format.h">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCustomBuildTool"
+						AdditionalDependencies="..\..\include\Flac\ordinals.h"/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\include\FLAC\metadata.h">
@@ -589,7 +637,8 @@
 					Name="Debug|Win32">
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="copy $(InputPath).vc2003 $(InputPath)"
+						CommandLine="copy $(InputPath).vc2003 $(InputPath)
+"
 						AdditionalDependencies="..\..\include\Flac\ordinals.h.vc2003"
 						Outputs="$(InputPath)"/>
 				</FileConfiguration>

Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp	2004-12-23 04:03:48 UTC (rev 8524)
@@ -33,9 +33,11 @@
 //===========================================================================
 
 #include "stdafx.h"
-#include "anxdemuxsourcefilter.h"
+#include "AnxDemuxSourceFilter.h"
 
+#include "AutoAnxSeekTable.h"
 
+
 //-------------------
 // This template lets the Object factory create us properly and work with COM infrastructure.
 CFactoryTemplate g_Templates[] = 

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -1,6 +1,13 @@
 #pragma once
+
+#include "libOOOggSeek.h"
+
 #include "AutoOggSeekTable.h"
 
+#include <string>
+
+using namespace std;
+
 class LIBOOOGGSEEK_API AutoAnxSeekTable
 	:	public AutoOggSeekTable
 {

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp	2004-12-23 04:03:48 UTC (rev 8524)
@@ -105,7 +105,7 @@
 			const int FLAC_STREAM_INFO_ID = 0;
 			
 			//Note ::: Secondary condition in for statement.
-            for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
+            for (unsigned int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
 				mNumHeaders++;
 				if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
                     //Catch the stream info packet.
@@ -137,11 +137,11 @@
 			//Loop any other packets
 
 			const int FLAC_LAST_HEADERS_FLAG = 128;
-			const int FLAC_HEADER_MASK = 127;
-			const int FLAC_STREAM_INFO_ID = 0;
+			// const int FLAC_HEADER_MASK = 127;  // Unused
+			// const int FLAC_STREAM_INFO_ID = 0;  // Unused
 			
 			//Note ::: Secondary condition in for statement.
-            for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
+            for (unsigned int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
 				mNumHeaders++;
 
 				//Don't need this, we already got this data... we're just counting headers.
@@ -159,7 +159,7 @@
 			LOOG_INT64 locTimePerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 17);
 			LOOG_INT64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 25);
 
-			mSampleRate = (10000000 / locTimePerBlock) * locSamplesPerBlock;
+			mSampleRate = (unsigned long) ( (10000000 / locTimePerBlock) * locSamplesPerBlock );
 			mFoundStreamInfo = true;
 			mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
 			mNumHeaders = 1;
@@ -192,7 +192,7 @@
 		
 		if (isTheora) {
 			unsigned long locMod = (unsigned long)pow((double) 2, (double) mGranulePosShift);
-			unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()) % locMod);
+			unsigned long locInterFrameNo = (unsigned long) ( (inOggPage->header()->GranulePos()) % locMod );
 			
 			//if (locInterFrameNo == 0) {
 			//	mLastIsSeekable = true;
@@ -220,7 +220,9 @@
 	return true;
 }
 unsigned long AutoOggSeekTable::serialisedSize() {
-	return mSeekMap.size() * 12;
+	// TODO: This really should return a size_t (in fact, all our file-size-related variables should really be
+	// a size_t), but let's just use ye olde unsigned long for now ...
+	return (unsigned long) mSeekMap.size() * 12;
 	
 }
 bool AutoOggSeekTable::serialiseInto(unsigned char* inBuff, unsigned long inBuffSize) {

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -30,17 +30,23 @@
 //===========================================================================
 
 #pragma once
-#include "OggSeekTable.h"
-#include "dllstuff.h"
+
+#include "iBE_Math.h"
+#include "iLE_Math.h"
+
+#include "libOOOgg.h"
+#include "libOOOggSeek.h"
+
 #include "IOggCallback.h"
 #include "OggDataBuffer.h"
-#include "iBE_Math.h"
-#include "iLE_Math.h"
+#include "OggSeekTable.h"
 //#include "FLACMath.h"
 #include "math.h"
 #include <fstream>
+
 using namespace std;
-class LIBOOOGGSEEK_API AutoOggSeekTable 
+
+class LIBOOOGGSEEK_API AutoOggSeekTable
 	:	public OggSeekTable
 	,	public IOggCallback
 {
@@ -83,4 +89,7 @@
 
 	//fstream debugLog;
 
+private:
+	AutoOggSeekTable(const AutoOggSeekTable&);  // Don't copy me
+    AutoOggSeekTable &operator=(const AutoOggSeekTable&);  // Don't assign men
 };

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -1,3 +1,7 @@
+#pragma once
+
+#include "libOOOggSeek.h"
+
 class IOggSeeker {
 
 	IOggSeeker();
@@ -9,7 +13,7 @@
 	//IOggCallback interface
 	virtual bool acceptOggPage(OggPage* inOggPage);
 
-	__int64 fileDuration();
+	LOOG_INT64 fileDuration();
 
 	bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
 	tSeekPair getStartPos(__int64 inTime);

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -32,6 +32,7 @@
 #pragma once
 
 #include "libilliCore.h"
+#include "libOOOggSeek.h"
 
 class OggSeekPoint
 {

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp	2004-12-23 04:03:48 UTC (rev 8524)
@@ -63,7 +63,7 @@
 
 }
 OggSeekTable::tSeekPair OggSeekTable::getStartPos(LOOG_INT64 inTime) {
-	 return *(mSeekMap.lower_bound(inTime));
+	 return *(--(mSeekMap.upper_bound(inTime)));
 	 //mRealStartPos = locValue.first;
 	 //stDebug<<"Get Point : Time Req = "<<inTime<<"   --   Time Given = "<<mRealStartPos<<"   --   Byte Pos : "<<locValue.second<<endl;
 	 //return locValue.second;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -30,10 +30,13 @@
 //===========================================================================
 
 #pragma once
+
 #include "libilliCore.h"
 #include "libOOOggSeek.h"
+
 #include <fstream>
 #include <map>
+
 using namespace std;
 
 class LIBOOOGGSEEK_API OggSeekTable
@@ -49,8 +52,10 @@
 	LOOG_INT64 getRealStartPos();
 
 	bool enabled();
+    
+    OggSeekTable(const OggSeekTable&);  // Don't copy me
+    OggSeekTable &operator=(const OggSeekTable&);  // Don't assign men
 
-
 protected:
 	typedef map<LOOG_INT64, unsigned long> tSeekMap;
 	tSeekMap mSeekMap;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp	2004-12-23 04:03:48 UTC (rev 8524)
@@ -34,6 +34,7 @@
 
 #include "stdafx.h"
 #include "libOOOggSeek.h"
+
 BOOL APIENTRY DllMain( HANDLE hModule, 
                        DWORD  ul_reason_for_call, 
                        LPVOID lpReserved

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -29,18 +29,15 @@
 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //===========================================================================
 
-// The following ifdef block is the standard way of creating macros which make exporting 
-// from a DLL simpler. All files within this DLL are compiled with the LIBOOOGGSEEK_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see 
-// LIBOOOGGSEEK_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
+#pragma once
+
 #ifdef WIN32
 # ifdef LIBOOOGGSEEK_EXPORTS
 #  define LIBOOOGGSEEK_API __declspec(dllexport)
 # else
 #  define LIBOOOGGSEEK_API __declspec(dllimport)
 # endif
+# include <windows.h>
 #else
 # define LIBOOOGGSEEK_API
 #endif

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h	2004-12-23 04:03:48 UTC (rev 8524)
@@ -41,3 +41,5 @@
 #ifdef WIN32
 # include <windows.h>
 #endif
+
+#include "libOOOggSeek.h"

Modified: trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp
===================================================================
--- trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp	2004-12-23 04:03:48 UTC (rev 8524)
@@ -38,6 +38,7 @@
 #include "stdafx.h"
 #include "libOOOgg.h"
 #include "dllstuff.h"
+#include "AutoAnxSeekTable.h"
 
 #include <iostream>
 #include <fstream>
@@ -51,6 +52,8 @@
 fstream outputFile;
 vector<tSerial_HeadCountPair> theStreams;
 
+using namespace std;
+
 enum eDemuxState {
 	SEEN_NOTHING,
 	SEEN_ANNODEX_BOS,
@@ -126,7 +129,7 @@
 			}
 			break;
 		case SEEN_ANNODEX_EOS:
-			for (int i = 0; i < theStreams.size(); i++) {
+			for (unsigned int i = 0; i < theStreams.size(); i++) {
 				if (theStreams[i].first == inOggPage->header()->StreamSerialNo()) {
 					if (theStreams[i].second >= 1) {
 						theStreams[i].second--;
@@ -138,7 +141,7 @@
 			}
 
 			
-			for (int i = 0; i < theStreams.size(); i++) {
+			for (unsigned int i = 0; i < theStreams.size(); i++) {
 				if (theStreams[i].second != 0) {
 					allEmpty = false;
 				}
@@ -150,7 +153,16 @@
 			}
 			break;
 		case SEEN_ALL_CODEC_HEADERS:
-			break;
+			{
+				// We've processed all the codec headers, so all the incoming packets should be codec data
+				unsigned long packetsInThisPage = inOggPage->numPackets();
+				for (unsigned long i = 0; i < packetsInThisPage; i++)
+				{
+					StampedOggPacket *packet = inOggPage->getStampedPacket(i);
+					cout << "Packet " << i << " start time: " << packet->startTime() << endl;
+				}
+				break;
+			}
 		case INVALID:
 			break;
 		default:
@@ -166,18 +178,19 @@
 	return true;
 }
 
-
+#ifdef WIN32
 int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
 {
 	demuxState = SEEN_NOTHING;
 
 	bytePos = 0;
 	gotAllHeaders = false;
 
-	int x;
-	cin>>x;
-	if (argc < 3) {
-		cout<<"Usage : AnxCutter <input_filename> <output_filename> <start_time> <end_time>"<<endl;
+	if (argc < 4) {
+		cout << "Usage : AnxCutter <input_filename> <output_filename> <start_time>" << endl;
 	} else {
 		OggDataBuffer testOggBuff;
 		
@@ -195,10 +208,30 @@
 			unsigned long locBytesRead = inputFile.gcount();
     		testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
 		}
+		inputFile.close();
 
+		// Build a seek table for the file
+		AutoAnxSeekTable *locSeekTable = new AutoAnxSeekTable(argv[1]);
+		locSeekTable->buildTable();
 
-		inputFile.close();
+		// Seek to the user's requested start time
+		LOOG_UINT64 locStartTime = StringHelper::stringToNum(argv[3]);
+		OggSeekTable::tSeekPair locSeekResult = locSeekTable->getStartPos(locStartTime);
+		cout << "Seek result for " << locStartTime << " nanoseconds: " << locSeekResult.first << " at " << locSeekResult.second << " bytes" << endl;
+
+		// Stream-copy everything from the requested timepoint onward to the output file
+		inputFile.open(argv[1], ios_base::in | ios_base::binary);
+		inputFile.seekg(locSeekResult.second);
+		while (true)
+		{
+			inputFile.read(locBuff, BUFF_SIZE);
+			unsigned long locBytesRead = inputFile.gcount();
+			if (locBytesRead == 0) break;
+			outputFile.write(locBuff, locBytesRead);
+		}
+
 		outputFile.close();
+
 		delete[] locBuff;
 	}
 

Modified: trunk/oggdsf/src/tools/AnxCutter/AnxCutter.vcproj
===================================================================
--- trunk/oggdsf/src/tools/AnxCutter/AnxCutter.vcproj	2004-12-22 22:39:58 UTC (rev 8523)
+++ trunk/oggdsf/src/tools/AnxCutter/AnxCutter.vcproj	2004-12-23 04:03:48 UTC (rev 8524)
@@ -19,7 +19,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg;.;..\..\lib\helper\libilliCore"
+				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg;.;..\..\lib\helper\libilliCore;..\..\lib\core\ogg\libOOOggSeek"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
 				MinimalRebuild="TRUE"
 				BasicRuntimeChecks="3"
@@ -68,7 +68,7 @@
 			CharacterSet="2">
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg;.;..\..\lib\helper\libilliCore"
+				AdditionalIncludeDirectories="..\..\lib\core\ogg\libOOOgg;.;..\..\lib\helper\libilliCore;..\..\lib\core\ogg\libOOOggSeek"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="3"



More information about the commits mailing list