[xiph-commits] r8589 - in trunk/oggdsf/src: lib/helper/libTemporalURI tests/testTemporal

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Sun Jan 2 22:23:28 PST 2005


Author: illiminable
Date: 2005-01-02 22:23:27 -0800 (Sun, 02 Jan 2005)
New Revision: 8589

Modified:
   trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
   trunk/oggdsf/src/tests/testTemporal/testTemporal.cpp
Log:
* Fixed some bugs in temporal URI library...

Modified: trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-03 05:29:09 UTC (rev 8588)
+++ trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp	2005-01-03 06:23:27 UTC (rev 8589)
@@ -21,7 +21,10 @@
 
 	if (locWasOK) {
 		if ( (locLeftOver.find(".") == 0) || (locLeftOver == "")) {
-			locLeftOver = locLeftOver.substr(1);
+			if (locLeftOver != "" ) {
+				locLeftOver = locLeftOver.substr(1);
+			}
+
 			if (locLeftOver == "") {
 				inFPT->partials = 0;
 				return true;
@@ -153,6 +156,7 @@
 	if (locDotPos == string::npos) {
 		//No dot here
 		locSS = StringHelper::stringToNum(inTimeStamp);
+		locNN = 0;
 	} else {
 		//Dotted time
 
@@ -182,6 +186,8 @@
 	switch (mStampType) {
 		case TS_NPT_SECS:
 			return (mSecs * 10000000) + (mHuns);
+		case TS_NPT_FULL:
+			return (mFPT.hours * 3600 * 10000000) + (mFPT.minutes * 60 * 10000000) + (mFPT.seconds * 10000000) + (mFPT.partials);
 		default:
 			return  -1;
 
@@ -209,7 +215,7 @@
 			return parseSecsOnly(inTimeStamp);
 		}
 
-	} else if (inTimeStamp.find("smpte-" == 0)) {
+	} else if (inTimeStamp.find("smpte-") == 0) {
 		//One of the smpt stamps
 		inTimeStamp = inTimeStamp.substr(6);
 

Modified: trunk/oggdsf/src/tests/testTemporal/testTemporal.cpp
===================================================================
--- trunk/oggdsf/src/tests/testTemporal/testTemporal.cpp	2005-01-03 05:29:09 UTC (rev 8588)
+++ trunk/oggdsf/src/tests/testTemporal/testTemporal.cpp	2005-01-03 06:23:27 UTC (rev 8589)
@@ -12,8 +12,11 @@
 
 	string locStr;
 
+	int x;
+	cin>>x;
+
 	do {
-		cout<<" : "<<endl;
+		cout<<" : ";
 		cin>>locStr;
 
 		if (locStr != "x") {



More information about the commits mailing list