Merge master.
[dcpomatic.git] / src / lib / transcode_job.cc
index 97e8bd416a0432697b14dcb2503d6f82d62ba2e0..4a85fa18aa8935d0a2c0ff5670f504de012b439e 100644 (file)
@@ -30,6 +30,9 @@
 
 #include "i18n.h"
 
+#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
+#define LOG_ERROR_NC(...)   _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR);
+
 using std::string;
 using std::stringstream;
 using std::fixed;
@@ -62,17 +65,20 @@ TranscodeJob::run ()
 {
        try {
 
-               _film->log()->log (N_("Transcode job starting"));
+               LOG_GENERAL_NC (N_("Transcode job starting"));
 
                _transcoder.reset (new Transcoder (_film, shared_from_this ()));
                _transcoder->go ();
                set_progress (1);
                set_state (FINISHED_OK);
 
-               _film->log()->log (N_("Transcode job completed successfully"));
+               LOG_GENERAL_NC (N_("Transcode job completed successfully"));
                _transcoder.reset ();
 
        } catch (...) {
+               set_progress (1);
+               set_state (FINISHED_ERROR);
+               LOG_ERROR_NC (N_("Transcode job failed or cancelled"));
                _transcoder.reset ();
                throw;
        }