ReadFileIntoString() modified to return OK when the file is empty
[asdcplib.git] / src / S12MTimecode.h
index 0a885287836aa1c858f535078a36bd37e708d657..6abe3f6e8a51a4b2aed9c8b59c84f3002e796bef 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2007, John Hurst
+Copyright (c) 2007-2014, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@ namespace ASDCP {
 
  class S12MTimecode : public Kumu::IArchive
 {
+ protected:
   ui32_t m_FrameCount;
   ui32_t m_FPS;
 
@@ -58,7 +59,7 @@ public:
     DecodeString(tc);
   }
 
-  S12MTimecode(const S12MTimecode& rhs) : m_FrameCount(0), m_FPS(0)
+  S12MTimecode(const S12MTimecode& rhs) : IArchive(), m_FrameCount(0), m_FPS(0)
   {
     m_FPS = rhs.m_FPS;
     m_FrameCount = rhs.m_FrameCount;
@@ -105,10 +106,10 @@ public:
 
     if ( *p != 0 )
       {
-       ui32_t hours = atoi(p);
-       ui32_t minutes = atoi(p+3);
-       ui32_t seconds = atoi(p+6);
-       ui32_t frames = atoi(p+9);
+       ui32_t hours = strtol(p, 0, 10);
+       ui32_t minutes = strtol(p+3, 0, 10);
+       ui32_t seconds = strtol(p+6, 0, 10);
+       ui32_t frames = strtol(p+9, 0, 10);
 
        m_FrameCount = (((((hours * 60) + minutes) * 60) + seconds) * m_FPS)+ frames;
       }