Tidy up test film naming.
[dcpomatic.git] / src / lib / transcode_job.cc
index 9113593f0c1976c4967df5df7e9c7bea509d38d4..fe34867b250123a8722f5fe83c15ac74f403c2ab 100644 (file)
@@ -39,8 +39,9 @@ using namespace boost;
  *  @param o Options.
  *  @param l A log that we can write to.
  */
-TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
-       : Job (s, o, l)
+TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
+       : Job (s, l, req)
+       , _opt (o)
 {
        
 }
@@ -48,9 +49,7 @@ TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Opti
 string
 TranscodeJob::name () const
 {
-       stringstream s;
-       s << "Transcode " << _fs->name;
-       return s.str ();
+       return String::compose ("Transcode %1", _fs->name());
 }
 
 void
@@ -70,12 +69,9 @@ TranscodeJob::run ()
 
        } catch (std::exception& e) {
 
-               stringstream s;
                set_progress (1);
                set_state (FINISHED_ERROR);
-
-               s << "Transcode job failed (" << e.what() << ")";
-               _log->log (s.str ());
+               _log->log (String::compose ("Transcode job failed (%1)", e.what()));
 
                throw;
        }
@@ -112,5 +108,5 @@ TranscodeJob::remaining_time () const
                return 0;
        }
 
-       return ((_fs->length - _encoder->last_frame()) / fps);
+       return ((_fs->dcp_length() - _encoder->last_frame()) / fps);
 }