summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-14 00:44:33 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-14 00:44:33 +0200
commit778a8b0e19715ed98969ce84cdf4859e1e0e7e52 (patch)
treecf5beb2423de9760c4410de2687c6b103db414b6 /src/lib
parent747e81de1927c71b39dc916be05bb9296ca6b882 (diff)
Try to give a better error when we fail to start J2K encoding
(probably because of a lack of addressable RAM). See #1540.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/j2k_encoder.cc3
-rw-r--r--src/lib/job.cc36
2 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index ac420517f..3d7b342da 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -116,6 +116,9 @@ J2KEncoder::end ()
terminate_threads ();
+ /* Something might have been thrown during terminate_threads */
+ rethrow ();
+
LOG_GENERAL (N_("Mopping up %1"), _queue.size());
/* The following sequence of events can occur in the above code:
diff --git a/src/lib/job.cc b/src/lib/job.cc
index a83249e79..a4ea9ec6f 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -122,6 +122,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 (