From 250050fded706adc5ac66131548c7afad8d3ac31 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 29 Sep 2024 20:31:38 +0200 Subject: Missing include. --- src/lib/cross.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/cross.h b/src/lib/cross.h index 6904811b7..884f3c79c 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -25,6 +25,7 @@ #ifndef DCPOMATIC_CROSS_H #define DCPOMATIC_CROSS_H +#include #ifdef DCPOMATIC_OSX #include #endif -- cgit v1.2.3 From d9a0b0db5d19f54822668e89edbbf3d32846c763 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 29 Sep 2024 21:20:51 +0200 Subject: Clarify some uses of bind(). GCC 14.2.1 somehow can't decide whether to use boost:: or std::bind. --- src/lib/hints.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/lib') diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 2e2a8fd7b..9eebe4030 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -56,7 +56,6 @@ using std::shared_ptr; using std::string; using std::weak_ptr; using boost::optional; -using boost::bind; using namespace dcpomatic; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; @@ -87,7 +86,7 @@ Hints::Hints (weak_ptr weak_film) void Hints::start () { - _thread = boost::thread (bind(&Hints::thread, this)); + _thread = boost::thread(boost::bind(&Hints::thread, this)); } @@ -392,11 +391,11 @@ Hints::scan_content(shared_ptr film) } if (check_loudness_done && have_text) { - emit (bind(boost::ref(Progress), _("Examining subtitles and closed captions"))); + emit(boost::bind(boost::ref(Progress), _("Examining subtitles and closed captions"))); } else if (!check_loudness_done && !have_text) { - emit (bind(boost::ref(Progress), _("Examining audio"))); + emit(boost::bind(boost::ref(Progress), _("Examining audio"))); } else { - emit (bind(boost::ref(Progress), _("Examining audio, subtitles and closed captions"))); + emit(boost::bind(boost::ref(Progress), _("Examining audio, subtitles and closed captions"))); } auto player = make_shared(film, Image::Alignment::COMPACT); @@ -406,9 +405,9 @@ Hints::scan_content(shared_ptr film) player->set_ignore_audio(); } else { /* Send auto to the analyser to check loudness */ - player->Audio.connect(bind(&Hints::audio, this, _1, _2)); + player->Audio.connect(boost::bind(&Hints::audio, this, _1, _2)); } - player->Text.connect(bind(&Hints::text, this, _1, _2, _3, _4)); + player->Text.connect(boost::bind(&Hints::text, this, _1, _2, _3, _4)); struct timeval last_pulse; gettimeofday(&last_pulse, 0); @@ -423,7 +422,7 @@ Hints::scan_content(shared_ptr film) if (_stop) { return; } - emit(bind(boost::ref(Pulse))); + emit(boost::bind(boost::ref(Pulse))); last_pulse = now; } } @@ -515,7 +514,7 @@ try } dcp::filesystem::remove_all(dcp_dir); - emit (bind(boost::ref(Finished))); + emit(boost::bind(boost::ref(Finished))); } catch (boost::thread_interrupted) { @@ -530,7 +529,7 @@ catch (...) void Hints::hint (string h) { - emit(bind(boost::ref(Hint), h)); + emit(boost::bind(boost::ref(Hint), h)); } -- cgit v1.2.3 From d2a09fd84fa75368c820eb443854dcf5f667f970 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 8 Oct 2024 19:47:30 +0200 Subject: I'm not sure if this is actually wrong, but it seems odd. I think possibly only the first call to ::instance() would be locked. --- src/lib/change_signaller.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/change_signaller.h b/src/lib/change_signaller.h index 1d7d482df..cda366076 100644 --- a/src/lib/change_signaller.h +++ b/src/lib/change_signaller.h @@ -101,7 +101,7 @@ public: static ChangeSignalDespatcher* instance() { static boost::mutex _instance_mutex; - static boost::mutex::scoped_lock lm(_instance_mutex); + boost::mutex::scoped_lock lm(_instance_mutex); static ChangeSignalDespatcher* _instance; if (!_instance) { _instance = new ChangeSignalDespatcher(); -- cgit v1.2.3 From 3368aefd9782b0e22b95c1bcf988fd9b1c10522e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 8 Oct 2024 19:49:33 +0200 Subject: Fix bug causing signal changes to be lost (#2870). It was possible (and I believe it happend) for new signals to be queued up in _pending while some old ones were being processed. They would then be cleared at the end of resume() without ever being sent. --- src/lib/change_signaller.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/change_signaller.h b/src/lib/change_signaller.h index cda366076..0b2c1539d 100644 --- a/src/lib/change_signaller.h +++ b/src/lib/change_signaller.h @@ -87,15 +87,13 @@ public: { boost::mutex::scoped_lock lm(_mutex); auto pending = _pending; + _pending.clear(); + _suspended = false; lm.unlock(); for (auto signal: pending) { signal.thing->signal_change(signal.type, signal.property); } - - lm.lock(); - _pending.clear(); - _suspended = false; } static ChangeSignalDespatcher* instance() -- cgit v1.2.3 From 638ce5e0b3bfc690eaf13ecdf82b6cb8817d1585 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 13 Oct 2024 21:15:58 +0200 Subject: Give more details when failing to send emails. --- src/lib/email.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/email.cc b/src/lib/email.cc index 8557b40e0..e2beb8f37 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -236,7 +236,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string auto const r = curl_easy_perform (curl); if (r != CURLE_OK) { - throw NetworkError (_("Failed to send email"), string(curl_easy_strerror(r))); + throw NetworkError(_("Failed to send email"), String::compose("%1 sending to %2:%3", curl_easy_strerror(r), server, port)); } curl_slist_free_all (recipients); -- cgit v1.2.3