Another try at sorting out the thorny question of timing.
[dcpomatic.git] / src / lib / ffmpeg_content.h
index c94b1937c7f95db1571929685b5e9dfdc5d4b274..c5ccee77a4509c55b87f374147a5333bdcd0685b 100644 (file)
@@ -1,5 +1,3 @@
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
 /*
     Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
 
@@ -48,6 +46,7 @@ public:
         int frame_rate;
        int channels;
        AudioMapping mapping;
+       boost::optional<double> first_audio;
 };
 
 extern bool operator== (FFmpegAudioStream const & a, FFmpegAudioStream const & b);
@@ -100,7 +99,7 @@ public:
 
         /* AudioContent */
         int audio_channels () const;
-        ContentAudioFrame audio_length () const;
+        AudioContent::Frame audio_length () const;
         int content_audio_frame_rate () const;
         int output_audio_frame_rate () const;
        AudioMapping audio_mapping () const;
@@ -135,12 +134,18 @@ public:
 
         void set_subtitle_stream (boost::shared_ptr<FFmpegSubtitleStream>);
         void set_audio_stream (boost::shared_ptr<FFmpegAudioStream>);
+
+       boost::optional<Time> first_video () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _first_video;
+       }
        
 private:
        std::vector<boost::shared_ptr<FFmpegSubtitleStream> > _subtitle_streams;
        boost::shared_ptr<FFmpegSubtitleStream> _subtitle_stream;
        std::vector<boost::shared_ptr<FFmpegAudioStream> > _audio_streams;
        boost::shared_ptr<FFmpegAudioStream> _audio_stream;
+       boost::optional<Time> _first_video;
        /** Video filters that should be used when generating DCPs */
        std::vector<Filter const *> _filters;
 };