diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-08 21:03:28 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-08 21:03:28 +0000 |
| commit | bb95f333f15ace7c032bb5b5761b512b6fe2e84e (patch) | |
| tree | d9486a34d1980804ceb9b2203e46de1bdf3bf9d8 /src/tools | |
| parent | 8af3fc82eb7d5955b09d94e1cc142f6a3adcf370 (diff) | |
Numerous fixes to A/B mode so that at least it doesn't crash (#72).
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dvdomatic.cc | 10 | ||||
| -rw-r--r-- | src/tools/servomatic_cli.cc | 9 | ||||
| -rw-r--r-- | src/tools/servomatic_gui.cc | 13 | ||||
| -rw-r--r-- | src/tools/servomatictest.cc | 6 |
4 files changed, 24 insertions, 14 deletions
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 4874e6ef8..230e02c88 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -482,12 +482,16 @@ class App : public wxApp #ifdef DVDOMATIC_POSIX unsetenv ("UBUNTU_MENUPROXY"); #endif - + + /* This needs to be before setup_i18n, as setup_i18n() will + create a Config object, which needs Scalers to have + been created. + */ + dvdomatic_setup (); + wxInitAllImageHandlers (); setup_i18n (); - dvdomatic_setup (); - if (!film_to_load.empty() && boost::filesystem::is_directory (film_to_load)) { try { film.reset (new Film (film_to_load)); diff --git a/src/tools/servomatic_cli.cc b/src/tools/servomatic_cli.cc index f8e713193..6626d45b9 100644 --- a/src/tools/servomatic_cli.cc +++ b/src/tools/servomatic_cli.cc @@ -42,7 +42,10 @@ #include "log.h" #include "version.h" -using namespace std; +using std::cerr; +using std::string; +using std::cout; +using boost::shared_ptr; static void help (string n) @@ -87,8 +90,8 @@ main (int argc, char* argv[]) } Scaler::setup_scalers (); - FileLog log ("servomatic.log"); - Server server (&log); + shared_ptr<FileLog> log (new FileLog ("servomatic.log")); + Server server (log); server.run (num_threads); return 0; } diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index 610ba8005..dd169725f 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -25,8 +25,11 @@ #include "lib/server.h" #include "lib/config.h" -using namespace std; -using namespace boost; +using std::cout; +using std::string; +using boost::shared_ptr; +using boost::thread; +using boost::bind; enum { ID_status = 1, @@ -52,7 +55,7 @@ private: string _log; }; -static MemoryLog memory_log; +static shared_ptr<MemoryLog> memory_log (new MemoryLog); class StatusDialog : public wxDialog { @@ -77,7 +80,7 @@ public: private: void update (wxTimerEvent &) { - _text->ChangeValue (std_to_wx (memory_log.get ())); + _text->ChangeValue (std_to_wx (memory_log->get ())); _sizer->Layout (); } @@ -141,7 +144,7 @@ private: void main_thread () { - Server server (&memory_log); + Server server (memory_log); server.run (Config::instance()->num_local_encoding_threads ()); } diff --git a/src/tools/servomatictest.cc b/src/tools/servomatictest.cc index 91ad02120..f5756c693 100644 --- a/src/tools/servomatictest.cc +++ b/src/tools/servomatictest.cc @@ -43,7 +43,7 @@ using std::pair; using boost::shared_ptr; static ServerDescription* server; -static FileLog log_ ("servomatictest.log"); +static shared_ptr<FileLog> log_ (new FileLog ("servomatictest.log")); static int frame = 0; void @@ -53,14 +53,14 @@ process_video (shared_ptr<Image> image, bool, shared_ptr<Subtitle> sub) new DCPVideoFrame ( image, sub, libdcp::Size (1024, 1024), 0, 0, 0, - Scaler::from_id ("bicubic"), frame, 24, "", 0, 250000000, &log_) + Scaler::from_id ("bicubic"), frame, 24, "", 0, 250000000, log_) ); shared_ptr<DCPVideoFrame> remote ( new DCPVideoFrame ( image, sub, libdcp::Size (1024, 1024), 0, 0, 0, - Scaler::from_id ("bicubic"), frame, 24, "", 0, 250000000, &log_) + Scaler::from_id ("bicubic"), frame, 24, "", 0, 250000000, log_) ); cout << "Frame " << frame << ": "; |
