[xiph-commits] r10833 - in trunk/oggdsf: build/oggcodecs src/lib/core/ogg/libOOOggSeek src/tools/UnTransmoggrify

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Feb 19 11:38:25 PST 2006


Author: illiminable
Date: 2006-02-19 11:38:09 -0800 (Sun, 19 Feb 2006)
New Revision: 10833

Modified:
   trunk/oggdsf/build/oggcodecs/oggcodecs.vdproj
   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/tools/UnTransmoggrify/UnTransmoggrify.cpp
Log:
* Fix seeking so it doesn't get confused by -1 gran pos where it shouldn't be
* Fix the seek map, so that it correctly returns the key pair with granule pos less than, rather than less or equal, which was causing to miss keyframe occasionally.
* Now seeks perfectly everytime

Modified: trunk/oggdsf/build/oggcodecs/oggcodecs.vdproj
===================================================================
--- trunk/oggdsf/build/oggcodecs/oggcodecs.vdproj	2006-02-19 11:53:35 UTC (rev 10832)
+++ trunk/oggdsf/build/oggcodecs/oggcodecs.vdproj	2006-02-19 19:38:09 UTC (rev 10833)
@@ -178,12 +178,6 @@
         "Entry"
         {
         "MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
-        "OwnerKey" = "8:_CC5E9D059E6044FA954061CAC6A8A1C0"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
         "OwnerKey" = "8:_C6ED1B8B0AAC495E9D25CDE58FC9E711"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -340,12 +334,6 @@
         "Entry"
         {
         "MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
-        "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_46A378A9B03E4612A645053EDB884C20"
         "OwnerKey" = "8:_0A1E63E5852E4F759F1A27E8F097727B"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -375,12 +363,6 @@
         }
         "Entry"
         {
-        "MsmKey" = "8:_5752F7DAA54F2A09A6DC1D6BEB922BDD"
-        "OwnerKey" = "8:_CC5E9D059E6044FA954061CAC6A8A1C0"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
         "MsmKey" = "8:_578B89273D59478F861AA5BC3600D074"
         "OwnerKey" = "8:_UNDEFINED"
         "MsmSig" = "8:_UNDEFINED"
@@ -478,12 +460,6 @@
         "Entry"
         {
         "MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
-        "OwnerKey" = "8:_CC5E9D059E6044FA954061CAC6A8A1C0"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
         "OwnerKey" = "8:_C6ED1B8B0AAC495E9D25CDE58FC9E711"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -652,12 +628,6 @@
         "Entry"
         {
         "MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
-        "OwnerKey" = "8:_0CADC4E67409461481DE8E39EA059436"
-        "MsmSig" = "8:_UNDEFINED"
-        }
-        "Entry"
-        {
-        "MsmKey" = "8:_655D5383153A6AB10D15352A7EABCC7A"
         "OwnerKey" = "8:_0A1E63E5852E4F759F1A27E8F097727B"
         "MsmSig" = "8:_UNDEFINED"
         }
@@ -1019,26 +989,6 @@
             "IsDependency" = "11:TRUE"
             "IsolateTo" = "8:"
             }
-            "{A582A373-4685-4296-BEFE-614B80A702C3}:_5752F7DAA54F2A09A6DC1D6BEB922BDD"
-            {
-            "SourcePath" = "8:WSOCK32.dll"
-            "TargetName" = "8:WSOCK32.dll"
-            "Tag" = "8:"
-            "Folder" = "8:_371AD289B6DB4693BDF7568485051F1E"
-            "Condition" = "8:"
-            "Transitive" = "11:FALSE"
-            "Vital" = "11:TRUE"
-            "ReadOnly" = "11:FALSE"
-            "Hidden" = "11:FALSE"
-            "System" = "11:FALSE"
-            "Permanent" = "11:FALSE"
-            "SharedLegacy" = "11:FALSE"
-            "PackageAs" = "3:1"
-            "Register" = "3:1"
-            "Exclude" = "11:TRUE"
-            "IsDependency" = "11:TRUE"
-            "IsolateTo" = "8:"
-            }
             "{A582A373-4685-4296-BEFE-614B80A702C3}:_655D5383153A6AB10D15352A7EABCC7A"
             {
             "SourcePath" = "8:MSVCR71D.dll"
@@ -1235,7 +1185,7 @@
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:oggcodecs"
         "ProductCode" = "8:{D65F0073-A820-4085-B997-A061171595A7}"
-        "PackageCode" = "8:{D5C2437E-5D98-49CA-805D-F9ED5654B46B}"
+        "PackageCode" = "8:{05A78791-212E-4917-AC92-03F63D652857}"
         "UpgradeCode" = "8:{1A644FEB-7597-4FAB-AADE-C2C7C64C5984}"
         "RestartWWWService" = "11:FALSE"
         "RemovePreviousVersions" = "11:TRUE"

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp	2006-02-19 11:53:35 UTC (rev 10832)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.cpp	2006-02-19 19:38:09 UTC (rev 10833)
@@ -88,10 +88,32 @@
 {
 	return mDuration;
 }
+
+bool AutoOggChainGranuleSeekTable::isUnstampedPage(OggPage* inOggPage)
+{
+	//This handles all the broken files out there which incorrectly have non -1 gran pos
+	//	when they should have -1.
+	//
+	//A page is now considered unstamped (and thus should according to the spec have -1 gran pos)
+	//	if it does in fact have -1 gran pos
+	//	OR 
+	//	if there is only one packet, and that packet is truncated.
+	if (inOggPage->header()->GranulePos() == -1) {
+		return true;
+	} else if ((inOggPage->numPackets() == 1) && (inOggPage->getPacket(0)->isTruncated())) {
+		return true;
+	} else {
+		return false;
+	}
+}
 bool AutoOggChainGranuleSeekTable::acceptOggPage(OggPage* inOggPage)
 {
+	//Get the granule pos of this page
 	LOOG_INT64 locGranule = inOggPage->header()->GranulePos();
+
+	//Get the serial number of this page
 	unsigned long locSerialNo = inOggPage->header()->StreamSerialNo();
+
 	sStreamMapping locMapping = getMapping(locSerialNo);
 
 	//There can be upto 2 incomplete packets on any page, one at the end and one at the start
@@ -100,7 +122,8 @@
 		locNumBrokenPacks += (inOggPage->getPacket(inOggPage->numPackets() - 1)->isTruncated() ? 1 : 0);
 	}
 	//Exclude pages, with -1 granule pos, or that have no complete packets
-	if (locGranule != -1) { 
+	//if (locGranule != -1) { 
+	if (!isUnstampedPage(inOggPage)) {
 		LOOG_INT64 locRealTime = -1;
 		if ((inOggPage->numPackets() > locNumBrokenPacks)) {
 			

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h	2006-02-19 11:53:35 UTC (rev 10832)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggChainGranuleSeekTable.h	2006-02-19 19:38:09 UTC (rev 10833)
@@ -36,6 +36,8 @@
 
 	vector<sStreamMapping> mStreamMaps;
 
+	bool isUnstampedPage(OggPage* inOggPage);
+
 	bool mIsEnabled;
 
 	LOOG_INT64 mDuration;

Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp	2006-02-19 11:53:35 UTC (rev 10832)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggGranuleSeekTable.cpp	2006-02-19 19:38:09 UTC (rev 10833)
@@ -72,10 +72,15 @@
 {
 	// 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)));
-	 //mRealStartPos = locValue.first;
-	 //stDebug<<"Get Point : Time Req = "<<inTime<<"   --   Time Given = "<<mRealStartPos<<"   --   Byte Pos : "<<locValue.second<<endl;
-	 //return locValue.second;
+    //return *(--(mSeekMap.upper_bound(inTime)));
+
+
+	tSeekMap::iterator locIt = mSeekMap.lower_bound(inTime);
+	if (locIt == mSeekMap.begin()) {
+		return *(locIt);
+	} else {
+		return *(--locIt);
+	}
 }
 
 /** Note that this method returns a copy of the seek table, not the actual seek table used by

Modified: trunk/oggdsf/src/tools/UnTransmoggrify/UnTransmoggrify.cpp
===================================================================
--- trunk/oggdsf/src/tools/UnTransmoggrify/UnTransmoggrify.cpp	2006-02-19 11:53:35 UTC (rev 10832)
+++ trunk/oggdsf/src/tools/UnTransmoggrify/UnTransmoggrify.cpp	2006-02-19 19:38:09 UTC (rev 10833)
@@ -216,7 +216,7 @@
 	bytePos = 0;
 
 	if (argc < 3) {
-		cout<<"Usage : OOOggDump <filename>"<<endl;
+		cout<<"Usage : Untransmoggrify <in filename> <out filename>"<<endl;
 	} else {
 
 		int x;



More information about the commits mailing list