X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fcontent_subtitle.cc;h=c4cfafad5bf99f243e0a63bc6ef579ba69018826;hb=78dd04db5ee5d1aa5fc915f04dc71cb53d33d059;hp=11873afee0a3791f00a28c10a5422c09ac4173ce;hpb=7f2e74604a51b984e4c8cbb5d5f4bb642677ec00;p=dcpomatic.git diff --git a/src/lib/content_subtitle.cc b/src/lib/content_subtitle.cc index 11873afee..c4cfafad5 100644 --- a/src/lib/content_subtitle.cc +++ b/src/lib/content_subtitle.cc @@ -19,18 +19,13 @@ #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()) + ); }