diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-01-26 22:42:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-01-26 22:42:18 +0000 |
| commit | 755b9af051c73dae5fffbe613fc45d9fd4fbd08d (patch) | |
| tree | 8efc5a92b62f0e9e04f6593ddab896cd42c22e38 /src/lib | |
| parent | 0985598b244ec2b82714a422e5d8381a08c6da35 (diff) | |
Fix hints object so that its lifetime is (nearly) the same as its thread.
Then when the thread AND Hints object are destroyed we get the Signaller's
destructor stuff to stop left-over hint signals being delivered.
Also add a hint about > 30fps DCP rates.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/hints.cc | 50 | ||||
| -rw-r--r-- | src/lib/hints.h | 3 |
2 files changed, 23 insertions, 30 deletions
diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 6238aa991..a517470d5 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net> + Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -62,39 +62,29 @@ Hints::Hints (weak_ptr<const Film> film) } void -Hints::stop_thread () +Hints::start () { - if (_thread) { - try { - { - boost::mutex::scoped_lock lm (_mutex); - _stop = true; - } - _thread->interrupt (); - _thread->join (); - } catch (...) { - - } - - delete _thread; - _thread = 0; - } + _thread = new boost::thread (bind(&Hints::thread, this)); } Hints::~Hints () { - stop_thread (); -} + if (!_thread) { + return; + } -void -Hints::start () -{ - stop_thread (); - _long_ccap = false; - _overlap_ccap = false; - _too_many_ccap_lines = false; - _stop = false; - _thread = new boost::thread (bind(&Hints::thread, this)); + try { + { + boost::mutex::scoped_lock lm (_mutex); + _stop = true; + } + _thread->interrupt (); + _thread->join (); + } catch (...) { + + } + + delete _thread; } void @@ -187,6 +177,10 @@ Hints::thread () hint (h); } + if (film->video_frame_rate() > 30) { + hint (String::compose(_("You are set up for a DCP at a frame rate of %1. This frame rate is not supported by all projectors. You are advised to change the DCP frame rate to %2."), film->video_frame_rate(), film->video_frame_rate() / 2)); + } + optional<double> lowest_speed_up; optional<double> highest_speed_up; BOOST_FOREACH (shared_ptr<const Content> i, content) { diff --git a/src/lib/hints.h b/src/lib/hints.h index 35e361842..6f0e533d4 100644 --- a/src/lib/hints.h +++ b/src/lib/hints.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -45,7 +45,6 @@ public: private: void thread (); - void stop_thread (); void hint (std::string h); void text (PlayerText text, TextType type, DCPTimePeriod period); |
