X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=2a21477fd5c744ab5cefad7403a743841a5a33fe;hb=b1e22dff981fb86ae04b12bb5a064e61030793a8;hp=79730d3472f7584e6aaccf95b2f46712e07f421d;hpb=6a3c03c5eed3cab8fdfdb04fcbaf6cabe8c715e9;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index 79730d347..2a21477fd 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -34,6 +34,7 @@ #include "cross.h" #include "crypto.h" #include "dcp_content_type.h" +#include "dcpomatic_log.h" #include "digester.h" #include "exceptions.h" #include "ffmpeg_image_proxy.h" @@ -410,8 +411,8 @@ LIBDCP_ENABLE_WARNINGS optional(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, dcp::Direction::LTR, "Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time(), 0 ); - subs.push_back (StringText(ss, 0)); - render_text (subs, list>(), dcp::Size(640, 480), DCPTime(), 24); + subs.push_back (StringText(ss, 0, {})); + render_text (subs, dcp::Size(640, 480), DCPTime(), 24); #endif Ratio::setup_ratios (); @@ -424,6 +425,8 @@ LIBDCP_ENABLE_WARNINGS curl_global_init (CURL_GLOBAL_ALL); ui_thread = boost::this_thread::get_id (); + + capture_asdcp_logs (); } #ifdef DCPOMATIC_WINDOWS @@ -591,14 +594,14 @@ short_audio_channel_name (int c) _("Rs"), _("HI"), _("VI"), - _("Lc"), - _("Rc"), + _("9"), + _("10"), _("BsL"), _("BsR"), _("DBP"), _("DBS"), _("Sign"), - "" + _("16") }; return channels[c]; @@ -1118,6 +1121,9 @@ default_font_file () if (!boost::filesystem::exists(liberation_normal)) { liberation_normal = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf"; } + if (!boost::filesystem::exists(liberation_normal)) { + liberation_normal = "/usr/share/fonts/liberation-sans/LiberationSans-Regular.ttf"; + } return liberation_normal; } @@ -1148,3 +1154,30 @@ start_of_thread (string) } #endif + +class LogSink : public Kumu::ILogSink +{ +public: + LogSink () {} + LogSink (LogSink const&) = delete; + LogSink& operator= (LogSink const&) = delete; + + void WriteEntry(const Kumu::LogEntry& entry) override { + Kumu::AutoMutex L(m_lock); + WriteEntryToListeners(entry); + if (entry.TestFilter(m_filter)) { + string buffer; + entry.CreateStringWithOptions(buffer, m_options); + LOG_GENERAL("asdcplib: %1", buffer); + } + } +}; + + +void +capture_asdcp_logs () +{ + static LogSink log_sink; + Kumu::SetDefaultLogSink(&log_sink); +} +