Fix crashes on x-thread signal emission.
[dcpomatic.git] / src / lib / content_subtitle.cc
index 11873afee0a3791f00a28c10a5422c09ac4173ce..c4cfafad5bf99f243e0a63bc6ef579ba69018826 100644 (file)
 
 #include "content_subtitle.h"
 
-ContentTime
-ContentTextSubtitle::from () const
+ContentTimePeriod
+ContentTextSubtitle::period () const
 {
        /* XXX: assuming we have some subs and they are all at the same time */
-       assert (!subs.empty ());
-       return ContentTime::from_seconds (double (subs.front().in().to_ticks()) / 250);
-}
-
-ContentTime
-ContentTextSubtitle::to () const
-{
-       /* XXX: assuming we have some subs and they are all at the same time */
-       assert (!subs.empty ());
-       return ContentTime::from_seconds (double (subs.front().out().to_ticks()) / 250);
+       DCPOMATIC_ASSERT (!subs.empty ());
+       return ContentTimePeriod (
+               ContentTime::from_seconds (subs.front().in().to_seconds()),
+               ContentTime::from_seconds (subs.front().out().to_seconds())
+               );
 }