[xiph-commits] r8665 - trunk/oggdsf/src/lib/helper/libTemporalURI

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Fri Jan 7 09:12:22 PST 2005


Author: illiminable
Date: 2005-01-07 09:12:21 -0800 (Fri, 07 Jan 2005)
New Revision: 8665

Modified:
   trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
Log:
* Fixed temporal uri parsing bugs... helps to store things you want to keep.

Modified: trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-07 16:40:36 UTC (rev 8664)
+++ trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-07 17:12:21 UTC (rev 8665)
@@ -63,6 +63,7 @@
 				if (locSubSec >= 0) {
 					//TODO::: Verify frames < numframes for type.
 					inFPT->partials = locSubSec;
+
 					return true;
 				} else {
 					return false;
@@ -159,8 +160,9 @@
 
 	if (locDotPos == string::npos) {
 		//No dot here
-		locSS = StringHelper::stringToNum(inTimeStamp);
-		locNN = 0;
+		mSecs = StringHelper::stringToNum(inTimeStamp);
+		mHuns = 0;
+		mStampType = TS_NPT_SECS;
 		return true;
 	} else {
 		//Dotted time
@@ -176,12 +178,13 @@
 			locNN = StringHelper::stringToFractNum(locHuns);
 		}
 
-		if (	(locSS >= 0) && (locNN >= 0) && (locSS <= 59) ) {
+		if (	(locSS >= 0) && (locNN >= 0)) {
 			mSecs = locSS;
 			mHuns = locNN;
 			mStampType = TS_NPT_SECS;
 			return true;
 		} else {
+			mStampType = TS_NONE;
 			return false;
 		}
 	}
@@ -213,11 +216,19 @@
 				mStampType = TS_NPT_FULL;
 				return true;
 			} else {
+				mStampType = TS_NONE;
 				return false;
 			}
 			
 		} else {
-			return parseSecsOnly(inTimeStamp);
+			bool locIsOK = parseSecsOnly(inTimeStamp);
+			if (locIsOK) {
+				mStampType = TS_NPT_SECS;
+				return true;
+			} else {
+				mStampType = TS_NONE;
+				return false;
+			}	
 		}
 
 	} else if (inTimeStamp.find("smpte-") == 0) {
@@ -238,9 +249,11 @@
 				mStampType = TS_SMPT;
 				return true;
 			} else {
+				mStampType = TS_NONE;
 				return false;
 			}
 		} else {
+			mStampType = TS_NONE;
 			return false;
 		}
 
@@ -248,10 +261,16 @@
 
 	} else {
 		//Assume it's default numeric npt
-		return parseSecsOnly(inTimeStamp);
+		bool locIsOK = parseSecsOnly(inTimeStamp);
+		if (locIsOK) {
+			mStampType = TS_NPT_SECS;
+			return true;
+		} else {
+			mStampType = TS_NONE;
+			return false;
+		}	
 
 
-
 	}
 
 }
\ No newline at end of file



More information about the commits mailing list