Assorted image subtitle fixes.
[dcpomatic.git] / src / lib / util.h
index bf1d0265b0dec3b90da1c0ba57414ed1868f6312..44bd7dcedceab0e48800bd45f9cf0a7418ac5566 100644 (file)
@@ -69,12 +69,29 @@ extern bool valid_j2k_file (boost::filesystem::path);
 extern boost::filesystem::path mo_path ();
 #endif
 extern std::string tidy_for_filename (std::string);
-extern dcp::Size fit_ratio_within (float ratio, dcp::Size, int);
+extern dcp::Size fit_ratio_within (float ratio, dcp::Size);
 extern int dcp_audio_frame_rate (int);
 extern int stride_round_up (int, int const *, int);
 extern int round_to (float n, int r);
 extern void* wrapped_av_malloc (size_t);
-extern ContentTimePeriod subtitle_period (AVSubtitle const &);
+
+class FFmpegSubtitlePeriod
+{
+public:
+       FFmpegSubtitlePeriod (ContentTime f)
+               : from (f)
+       {}
+
+       FFmpegSubtitlePeriod (ContentTime f, ContentTime t)
+               : from (f)
+               , to (t)
+       {}
+
+       ContentTime from;
+       boost::optional<ContentTime> to;
+};
+
+extern FFmpegSubtitlePeriod subtitle_period (AVSubtitle const &);
 extern void set_backtrace_file (boost::filesystem::path);
 extern dcp::FrameInfo read_frame_info (FILE* file, int frame, Eyes eyes);
 extern void write_frame_info (FILE* file, int frame, Eyes eyes, dcp::FrameInfo info);