Merge master.
[dcpomatic.git] / src / lib / player.cc
index d340ea9b46d8ff76e0ce0b88c97f90dbc74891da..f83e4ed26b7368228db0cad5e476d27c05a1ab7b 100644 (file)
@@ -81,7 +81,7 @@ Player::Player (shared_ptr<const Film> f, shared_ptr<const Playlist> p)
        _playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
        _playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
        _film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
-       set_video_container_size (fit_ratio_within (_film->container()->ratio (), _film->full_frame ()));
+       set_video_container_size (_film->frame_size ());
 }
 
 void
@@ -162,7 +162,7 @@ Player::pass ()
                if (earliest_audio.get() < 0) {
                        earliest_audio = DCPTime ();
                }
-               TimedAudioBuffers<DCPTime> tb = _audio_merger.pull (earliest_audio);
+               TimedAudioBuffers tb = _audio_merger.pull (earliest_audio);
                Audio (tb.audio, tb.time);
                /* This assumes that the audio-frames-to-time conversion is exact
                   so that there are no accumulated errors caused by rounding.
@@ -383,7 +383,7 @@ Player::emit_audio (weak_ptr<Piece> weak_piece, shared_ptr<DecodedAudio> audio)
 void
 Player::flush ()
 {
-       TimedAudioBuffers<DCPTime> tb = _audio_merger.flush ();
+       TimedAudioBuffers tb = _audio_merger.flush ();
        if (_audio && tb.audio) {
                Audio (tb.audio, tb.time);
                _audio_position += DCPTime::from_frames (tb.audio->frames (), _film->audio_frame_rate ());
@@ -486,7 +486,7 @@ Player::setup_pieces ()
                /* FFmpeg */
                shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (*i);
                if (fc) {
-                       decoder.reset (new FFmpegDecoder (_film, fc, _video, _audio));
+                       decoder.reset (new FFmpegDecoder (fc, _film->log(), _video, _audio, _film->with_subtitles ()));
                        frc = FrameRateChange (fc->video_frame_rate(), _film->video_frame_rate());
                }
 
@@ -502,7 +502,7 @@ Player::setup_pieces ()
                        }
 
                        if (!decoder) {
-                               decoder.reset (new ImageDecoder (_film, ic));
+                               decoder.reset (new ImageDecoder (ic));
                        }
 
                        frc = FrameRateChange (ic->video_frame_rate(), _film->video_frame_rate());
@@ -511,14 +511,14 @@ Player::setup_pieces ()
                /* SndfileContent */
                shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (*i);
                if (sc) {
-                       decoder.reset (new SndfileDecoder (_film, sc));
+                       decoder.reset (new SndfileDecoder (sc));
                        frc = best_overlap_frc;
                }
 
                /* SubRipContent */
                shared_ptr<const SubRipContent> rc = dynamic_pointer_cast<const SubRipContent> (*i);
                if (rc) {
-                       decoder.reset (new SubRipDecoder (_film, rc));
+                       decoder.reset (new SubRipDecoder (rc));
                        frc = best_overlap_frc;
                }