X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fplayer.cc;h=1d3e22e2094435f0488237ebb179357a40533076;hb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;hp=f22a6480f224f678dc803b08fdd9844e647e9b1a;hpb=13aae5d8ff27886656ab7ea3ef1194987954bb3f;p=dcpomatic.git diff --git a/src/lib/player.cc b/src/lib/player.cc index f22a6480f..1d3e22e20 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -71,6 +72,7 @@ using std::map; using std::make_pair; using std::copy; using boost::shared_ptr; +using boost::make_shared; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; @@ -139,7 +141,7 @@ Player::setup_pieces () decoder->audio->set_ignore (); } - _pieces.push_back (shared_ptr (new Piece (i, decoder, frc))); + _pieces.push_back (make_shared (i, decoder, frc)); } _have_valid_pieces = true; @@ -278,7 +280,7 @@ Player::black_player_video_frame (DCPTime time) const { return shared_ptr ( new PlayerVideo ( - shared_ptr (new RawImageProxy (_black_image)), + make_shared (_black_image), time, Crop (), optional (), @@ -374,12 +376,12 @@ Player::get_video (DCPTime time, bool accurate) shared_ptr ( new PlayerVideo ( i->image, - content_video_to_dcp (piece, i->frame), + time, piece->content->video->crop (), - piece->content->video->fade (i->frame), + piece->content->video->fade (i->frame.index()), image_size, _video_container_size, - i->eyes, + i->frame.eyes(), i->part, piece->content->video->colour_conversion () ) @@ -413,7 +415,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) Frame const length_frames = length.frames_round (_film->audio_frame_rate ()); - shared_ptr audio (new AudioBuffers (_film->audio_channels(), length_frames)); + shared_ptr audio = make_shared (_film->audio_channels(), length_frames); audio->make_silent (); list > ov = overlaps (time, time + length, has_audio); @@ -470,13 +472,13 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) /* Gain */ if (i->content->audio->gain() != 0) { - shared_ptr gain (new AudioBuffers (all.audio)); + shared_ptr gain = make_shared (all.audio); gain->apply_gain (i->content->audio->gain ()); all.audio = gain; } /* Remap channels */ - shared_ptr dcp_mapped (new AudioBuffers (_film->audio_channels(), all.audio->frames())); + shared_ptr dcp_mapped = make_shared (_film->audio_channels(), all.audio->frames()); dcp_mapped->make_silent (); AudioMapping map = j->mapping (); for (int i = 0; i < map.input_channels(); ++i) {