- bool _subtitles;
-
- /** Our decoders are ready to go; if this is false the decoders must be (re-)created before they are used */
- bool _have_valid_decoders;
- /** Video decoders in order of presentation */
- std::vector<boost::shared_ptr<VideoDecoder> > _video_decoders;
- /** Start positions of each video decoder in seconds*/
- std::vector<double> _video_start;
- /** Index of current video decoder */
- size_t _video_decoder;
- /** Audio decoders in order of presentation (if they are from FFmpeg) */
- std::vector<boost::shared_ptr<AudioDecoder> > _audio_decoders;
- /** Start positions of each audio decoder (if they are from FFmpeg) in seconds */
- std::vector<double> _audio_start;
- /** Current audio decoder index if we are running them sequentially; otherwise undefined */
- size_t _sequential_audio_decoder;
-
- boost::shared_ptr<AudioBuffers> _audio_buffers;
- boost::optional<double> _audio_time;
+
+ /** Our pieces are ready to go; if this is false the pieces must be (re-)created before they are used */
+ bool _have_valid_pieces;
+ std::list<boost::shared_ptr<Piece> > _pieces;
+
+ /** The time after the last video that we emitted */
+ Time _video_position;
+ /** The time after the last audio that we emitted */
+ Time _audio_position;
+
+ AudioMerger<Time, AudioContent::Frame> _audio_merger;
+
+ libdcp::Size _video_container_size;
+ boost::shared_ptr<PlayerImage> _black_frame;
+ std::map<boost::shared_ptr<AudioContent>, boost::shared_ptr<Resampler> > _resamplers;
+
+ struct {
+ boost::weak_ptr<Piece> piece;
+ boost::shared_ptr<Image> image;
+ dcpomatic::Rect<double> rect;
+ Time from;
+ Time to;
+ } _in_subtitle;
+
+ struct {
+ boost::shared_ptr<Image> image;
+ Position<int> position;
+ Time from;
+ Time to;
+ } _out_subtitle;
+
+#ifdef DCPOMATIC_DEBUG
+ boost::shared_ptr<Content> _last_video;
+#endif
+
+ bool _last_emit_was_black;
+
+ IncomingVideo _last_incoming_video;
+
+ boost::signals2::scoped_connection _playlist_changed_connection;
+ boost::signals2::scoped_connection _playlist_content_changed_connection;
+ boost::signals2::scoped_connection _film_changed_connection;