#include <iomanip>
#include "transcode_job.h"
#include "film.h"
-#include "format.h"
#include "transcoder.h"
#include "log.h"
-#include "encoder.h"
#include "i18n.h"
/** @param s Film to use.
*/
-TranscodeJob::TranscodeJob (shared_ptr<Film> f)
+TranscodeJob::TranscodeJob (shared_ptr<const Film> f)
: Job (f)
{
try {
_film->log()->log (N_("Transcode job starting"));
- _film->log()->log (String::compose (N_("Audio delay is %1ms"), _film->audio_delay()));
_transcoder.reset (new Transcoder (_film, shared_from_this ()));
_transcoder->go ();
s << Job::status ();
if (!finished ()) {
- s << N_("; ") << fixed << setprecision (1) << fps << N_(" ") << _("frames per second");
+ if (_transcoder->state() == Encoder::TRANSCODING) {
+ s << "; " << fixed << setprecision (1) << fps << N_(" ") << _("frames per second");
+ } else {
+ /* TRANSLATORS: this means `computing a hash' as in a digest of a block of data */
+ s << "; " << _("hashing");
+ }
}
return s.str ();
return 0;
}
- if (!_film->video_length()) {
- return 0;
- }
-
/* Compute approximate proposed length here, as it's only here that we need it */
- int length = _film->video_length();
- FrameRateConversion const frc (_film->video_frame_rate(), _film->dcp_frame_rate());
- if (frc.skip) {
- length /= 2;
- }
- /* If we are repeating it shouldn't affect transcode time, so don't take it into account */
-
- int const left = length - _transcoder->video_frames_out();
+ OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - _transcoder->video_frames_out();
return left / fps;
}