X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.cc;h=e8c3b8c71363292bccd5cbd8c1dea57bf26f0990;hb=1d2a51bdc8315fa7283be329669860e435a1513f;hp=9561c32b5197ce1551db7f4e6383c4a313d871f4;hpb=b057363e69b77119137c0c8b07402828096e03aa;p=dcpomatic.git diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 9561c32b5..e8c3b8c71 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -65,9 +65,9 @@ using std::list; using std::bad_alloc; using std::make_pair; using std::exception; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; -using boost::weak_ptr; +using std::shared_ptr; +using std::dynamic_pointer_cast; +using std::weak_ptr; using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; @@ -93,9 +93,6 @@ FilmViewer::FilmViewer (wxWindow* p) , _closed_captions_dialog (new ClosedCaptionsDialog(p, this)) , _outline_content (false) , _pad_black (false) -#ifdef DCPOMATIC_VARIANT_SWAROOP - , _background_image (false) -#endif , _idle_get (false) { switch (Config::instance()->video_view_type()) { @@ -140,11 +137,11 @@ FilmViewer::idle_handler () return; } - if (_video_view->display_next_frame(true)) { - _idle_get = false; - } else { + if (_video_view->display_next_frame(true) == VideoView::AGAIN) { /* get() could not complete quickly so we'll try again later */ signal_manager->when_idle (boost::bind(&FilmViewer::idle_handler, this)); + } else { + _idle_get = false; } } @@ -215,11 +212,12 @@ FilmViewer::recreate_butler () _butler.reset( new Butler( + _film, _player, Config::instance()->audio_mapping(_audio_channels), _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), - VIDEO_RANGE_FULL, + VideoRange::FULL, false, true ) @@ -348,8 +346,11 @@ FilmViewer::start () } _playing = true; - _video_view->start (); + /* Calling start() below may directly result in Stopped being emitted, and if that + * happens we want it to come after the Started signal, so do that first. + */ Started (position()); + _video_view->start (); } bool @@ -444,7 +445,7 @@ FilmViewer::quick_refresh () if (!_video_view || !_film || !_player) { return true; } - return _video_view->refresh_metadata (_film, _player->video_container_size(), _film->frame_size()); + return _video_view->reset_metadata (_film, _player->video_container_size()); } void @@ -462,7 +463,7 @@ FilmViewer::set_coalesce_player_changes (bool c) _coalesce_player_changes = c; if (!c) { - BOOST_FOREACH (int i, _pending_player_changes) { + for (auto i: _pending_player_changes) { player_change (CHANGE_TYPE_DONE, i, false); } _pending_player_changes.clear (); @@ -498,7 +499,7 @@ FilmViewer::seek (DCPTime t, bool accurate) /* We're going to start playing again straight away so wait for the seek to finish. */ - while (!_video_view->display_next_frame(false)) {} + while (_video_view->display_next_frame(false) == VideoView::AGAIN) {} } resume (); @@ -507,13 +508,6 @@ FilmViewer::seek (DCPTime t, bool accurate) void FilmViewer::config_changed (Config::Property p) { -#ifdef DCPOMATIC_VARIANT_SWAROOP - if (p == Config::PLAYER_BACKGROUND_IMAGE) { - _video_view->update (); - return; - } -#endif - if (p == Config::AUDIO_MAPPING) { recreate_butler (); return; @@ -628,7 +622,7 @@ FilmViewer::average_latency () const } Frame total = 0; - BOOST_FOREACH (Frame i, _latency_history) { + for (auto i: _latency_history) { total += i; }