[xiph-commits] r9108 - trunk/oggdsf/src/lib/core/ogg/libOOOgg

ozone at motherfish-iii.xiph.org ozone at motherfish-iii.xiph.org
Sun Apr 3 07:14:03 PDT 2005


Author: ozone
Date: 2005-04-03 07:14:01 -0700 (Sun, 03 Apr 2005)
New Revision: 9108

Modified:
   trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
Log:
oggcodecs:
 * Use int64s rather than unsigned long for some values in OggMuxStream::ConvertTime to prevent overflow problems (kudos to illi for this fix)


Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2005-04-03 14:12:19 UTC (rev 9107)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp	2005-04-03 14:14:01 UTC (rev 9108)
@@ -120,20 +120,15 @@
 			retTime = (inGranulePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
 		} else {
 			//Timestamp hacks start here...
-			unsigned long locMod = (unsigned long)pow((double) 2, (double) mConvTheoraLogKeyFrameInterval);
-			
-			unsigned long locInterFrameNo = (unsigned long)((inGranulePos) % locMod);
-	
+			LOOG_INT64 locMod = (LOOG_INT64)pow((double) 2, (double) mConvTheoraLogKeyFrameInterval);
+			LOOG_INT64 locInterFrameNo = ((inGranulePos) % locMod);
+
 			LOOG_INT64 locAbsFramePos = (inGranulePos >> mConvTheoraLogKeyFrameInterval) + locInterFrameNo;
 	
 			retTime = (locAbsFramePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
-			
-			
 		}
 	} 
 	return retTime;
-		
-	
 }
 
 bool OggMuxStream::setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor) {



More information about the commits mailing list