Merge master.
[dcpomatic.git] / src / lib / ab_transcode_job.cc
index 025c23c86e633cb00c2867e9d7b370bb5f58cd76..a29e7877666fc3c18ac82812f9f7247120dda0c0 100644 (file)
 #include <stdexcept>
 #include "ab_transcode_job.h"
 #include "film.h"
-#include "format.h"
-#include "filter.h"
 #include "ab_transcoder.h"
 #include "config.h"
-#include "encoder.h"
+#include "log.h"
+
+#include "i18n.h"
 
 using std::string;
 using boost::shared_ptr;
 
 /** @param f Film to compare.
- *  @param o Decode options.
  */
-ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, DecodeOptions o)
+ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f)
        : Job (f)
-       , _decode_opt (o)
 {
        _film_b.reset (new Film (*_film));
        _film_b->set_scaler (Config::instance()->reference_scaler ());
-       _film_b->set_filters (Config::instance()->reference_filters ());
+       /* XXX */
+//     _film_b->set_filters (Config::instance()->reference_filters ());
 }
 
 string
 ABTranscodeJob::name () const
 {
-       return String::compose ("A/B transcode %1", _film->name());
+       return String::compose (_("A/B transcode %1"), _film->name());
 }
 
 void
@@ -52,14 +51,18 @@ ABTranscodeJob::run ()
 {
        try {
                /* _film_b is the one with reference filters */
-               ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr<Encoder> (new Encoder (_film)));
+               ABTranscoder w (_film_b, _film, shared_from_this ());
                w.go ();
                set_progress (1);
                set_state (FINISHED_OK);
 
+               _film->log()->log ("A/B transcode job completed successfully");
+
        } catch (std::exception& e) {
 
+               set_progress (1);
                set_state (FINISHED_ERROR);
-
+               _film->log()->log (String::compose ("A/B transcode job failed (%1)", e.what()));
+               throw;
        }
 }