[xiph-commits] r8666 - trunk/oggdsf/src/lib/helper/libTemporalURI
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Fri Jan 7 09:14:29 PST 2005
Author: illiminable
Date: 2005-01-07 09:14:28 -0800 (Fri, 07 Jan 2005)
New Revision: 8666
Modified:
trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
Log:
* Handle the exception too.
Modified: trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp 2005-01-07 17:12:21 UTC (rev 8665)
+++ trunk/oggdsf/src/lib/helper/libTemporalURI/C_TimeStamp.cpp 2005-01-07 17:14:28 UTC (rev 8666)
@@ -204,23 +204,64 @@
bool C_TimeStamp::parseTimeStamp(string inTimeStamp)
{
- if (inTimeStamp.find("npt:") == 0) {
- //NPT time stamp
- inTimeStamp = inTimeStamp.substr(4);
+ try {
+ if (inTimeStamp.find("npt:") == 0) {
+ //NPT time stamp
+ inTimeStamp = inTimeStamp.substr(4);
- if (inTimeStamp.find(":") != string::npos) {
- //We have four part time
- sFourPartTime locFPT;
- if ( parseNPT(inTimeStamp, &locFPT) ) {
- mFPT = locFPT;
- mStampType = TS_NPT_FULL;
- return true;
+ if (inTimeStamp.find(":") != string::npos) {
+ //We have four part time
+ sFourPartTime locFPT;
+ if ( parseNPT(inTimeStamp, &locFPT) ) {
+ mFPT = locFPT;
+ mStampType = TS_NPT_FULL;
+ return true;
+ } else {
+ mStampType = TS_NONE;
+ return false;
+ }
+
} else {
+ bool locIsOK = parseSecsOnly(inTimeStamp);
+ if (locIsOK) {
+ mStampType = TS_NPT_SECS;
+ return true;
+ } else {
+ mStampType = TS_NONE;
+ return false;
+ }
+ }
+
+ } else if (inTimeStamp.find("smpte-") == 0) {
+ //One of the smpt stamps
+ inTimeStamp = inTimeStamp.substr(6);
+
+ size_t locColonPos = inTimeStamp.find(":");
+
+ if (locColonPos != string::npos) {
+ string locFrameRate = inTimeStamp.substr(0, locColonPos);
+
+ //TODO::: Need to set the spec type here...
+ inTimeStamp = inTimeStamp.substr(locColonPos + 1);
+
+ sFourPartTime locFPT;
+ if ( parseSMPT(inTimeStamp, &locFPT) ) {
+ mFPT = locFPT;
+ mStampType = TS_SMPT;
+ return true;
+ } else {
+ mStampType = TS_NONE;
+ return false;
+ }
+ } else {
mStampType = TS_NONE;
return false;
}
-
+
+
+
} else {
+ //Assume it's default numeric npt
bool locIsOK = parseSecsOnly(inTimeStamp);
if (locIsOK) {
mStampType = TS_NPT_SECS;
@@ -229,48 +270,13 @@
mStampType = TS_NONE;
return false;
}
- }
- } else if (inTimeStamp.find("smpte-") == 0) {
- //One of the smpt stamps
- inTimeStamp = inTimeStamp.substr(6);
- size_t locColonPos = inTimeStamp.find(":");
-
- if (locColonPos != string::npos) {
- string locFrameRate = inTimeStamp.substr(0, locColonPos);
-
- //TODO::: Need to set the spec type here...
- inTimeStamp = inTimeStamp.substr(locColonPos + 1);
-
- sFourPartTime locFPT;
- if ( parseSMPT(inTimeStamp, &locFPT) ) {
- mFPT = locFPT;
- mStampType = TS_SMPT;
- return true;
- } else {
- mStampType = TS_NONE;
- return false;
- }
- } else {
- mStampType = TS_NONE;
- return false;
}
+ } catch (...) {
+ mStampType = TS_NONE;
+ return false;
-
-
- } else {
- //Assume it's default numeric npt
- 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