X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fjob.cc;h=d960dfaee99f0da96f329cc82a2b97082556f51d;hb=44532cd5f87df3ef10bbbd6b987492e36e4a0eb6;hp=04aa227b7a46c749f03c6ae56e6eb43a66645f38;hpb=ea6b2dae46caa1da829fbf499e83cd6ae3b3773a;p=dcpomatic.git diff --git a/src/lib/job.cc b/src/lib/job.cc index 04aa227b7..d960dfaee 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -62,22 +62,21 @@ Job::Job (shared_ptr film) Job::~Job () { - stop_thread (); +#ifdef DCPOMATIC_DEBUG + /* Any subclass should have called stop_thread in its destructor */ + assert (!_thread.joinable()); +#endif } void Job::stop_thread () { - if (!_thread.joinable()) { - return; - } + boost::this_thread::disable_interruption dis; _thread.interrupt (); try { _thread.join (); - } catch (...) { - /* Too late to do anything about this */ - } + } catch (...) {} } /** Start the job in a separate thread, returning immediately */ @@ -119,6 +118,42 @@ Job::run_wrapper () set_progress (1); set_state (FINISHED_ERROR); + } catch (dcp::StartCompressionError& e) { + + bool done = false; + +#ifdef DCPOMATIC_WINDOWS +#if (__GNUC__ && !__x86_64__) + /* 32-bit */ + set_error ( + _("Failed to encode the DCP."), + _("This error has probably occurred because you are running the 32-bit version of DCP-o-matic and " + "trying to use too many encoding threads. Please reduce the 'number of threads DCP-o-matic should " + "use' in the General tab of Preferences and try again.") + ); + done = true; +#else + /* 64-bit */ + if (running_32_on_64()) { + set_error ( + _("Failed to encode the DCP."), + _("This error has probably occurred because you are running the 32-bit version of DCP-o-matic. Please re-install DCP-o-matic with the 64-bit installer and try again.") + ); + done = true; + } +#endif +#endif + + if (!done) { + set_error ( + e.what (), + string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM + ); + } + + set_progress (1); + set_state (FINISHED_ERROR); + } catch (OpenFileError& e) { set_error ( @@ -175,7 +210,7 @@ Job::run_wrapper () set_progress (1); set_state (FINISHED_ERROR); - } catch (dcp::DCPReadError& e) { + } catch (dcp::ReadError& e) { set_error (e.message(), e.detail().get_value_or("")); set_progress (1);