Explicitly set the DirScanner handle to NULL (-1 for Windows) on instantiation.
[asdcplib.git] / src / TimedText_Parser.cpp
index 8fc09fc9ed72cfb17c32d7ae39a884fb51ca08e1..d86ef7c4772524709b96cc7365fccb978f268e5d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2007-2008, John Hurst
+Copyright (c) 2007-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -268,8 +268,14 @@ ASDCP::TimedText::DCSubtitleParser::h__SubtitleParser::OpenRead(const char* file
     }
 
   // assumes 24/1 or 48/1 as constrained above
+  assert(m_TDesc.EditRate.Denominator == 1);
 
-  S12MTimecode beginTC(m_Root.GetChildWithName("StartTime")->GetBody(), m_TDesc.EditRate.Numerator);
+  S12MTimecode beginTC;
+  beginTC.SetFPS(m_TDesc.EditRate.Numerator);
+  XMLElement* StartTime = m_Root.GetChildWithName("StartTime");
+
+  if ( StartTime != 0 )
+    beginTC.DecodeString(StartTime->GetBody());
 
   for ( ei = InstanceList.begin(); ei != InstanceList.end(); ei++ )
     {