summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-10 10:02:20 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-10 10:02:20 +0100
commitcb33319a820b17a05cfb2ef78ba1799f4d0c54b9 (patch)
tree7529501950b16db912a527d269ed83e39a37f7d6 /src/lib
parent3781be4da4601176d7bb954f9cc65621d75e7344 (diff)
parenta097506d4867fec47406283caa5b262a21791585 (diff)
Merge branch 'master' of /home/carl/git/dvdomatic
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ab_transcoder.cc2
-rw-r--r--src/lib/check_hashes_job.cc4
-rw-r--r--src/lib/decoder.cc17
-rw-r--r--src/lib/decoder.h2
-rw-r--r--src/lib/decoder_factory.cc2
-rw-r--r--src/lib/ffmpeg_decoder.cc38
-rw-r--r--src/lib/film.cc15
-rw-r--r--src/lib/film_state.cc28
-rw-r--r--src/lib/film_state.h2
-rw-r--r--src/lib/format.cc124
-rw-r--r--src/lib/format.h71
-rw-r--r--src/lib/image.cc2
-rw-r--r--src/lib/j2k_still_encoder.cc4
-rw-r--r--src/lib/j2k_still_encoder.h4
-rw-r--r--src/lib/j2k_wav_encoder.cc12
-rw-r--r--src/lib/job_manager.cc14
-rw-r--r--src/lib/job_manager.h1
-rw-r--r--src/lib/options.h5
-rw-r--r--src/lib/transcode_job.cc2
19 files changed, 200 insertions, 149 deletions
diff --git a/src/lib/ab_transcoder.cc b/src/lib/ab_transcoder.cc
index 95492a9d8..1c20ae477 100644
--- a/src/lib/ab_transcoder.cc
+++ b/src/lib/ab_transcoder.cc
@@ -112,7 +112,7 @@ ABTranscoder::go ()
bool const b = _db->pass ();
if (_job) {
- _job->set_progress (float (_last_frame) / _da->decoding_frames ());
+ _job->set_progress (float (_last_frame) / _fs_a->dcp_length());
}
if (a && b) {
diff --git a/src/lib/check_hashes_job.cc b/src/lib/check_hashes_job.cc
index cf269564a..f60a2d40d 100644
--- a/src/lib/check_hashes_job.cc
+++ b/src/lib/check_hashes_job.cc
@@ -48,8 +48,10 @@ void
CheckHashesJob::run ()
{
_bad = 0;
+
+ int const N = _fs->dcp_length ();
- for (int i = 0; i < _fs->length; ++i) {
+ for (int i = 0; i < N; ++i) {
string const j2k_file = _opt->frame_out_path (i, false);
string const hash_file = j2k_file + ".md5";
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 8aa5f77c6..324d1a296 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -112,7 +112,7 @@ Decoder::process_end ()
*/
int64_t const audio_short_by_frames =
- ((int64_t) decoding_frames() * _fs->target_sample_rate() / _fs->frames_per_second)
+ ((int64_t) _fs->dcp_length() * _fs->target_sample_rate() / _fs->frames_per_second)
- _audio_frames_processed;
if (audio_short_by_frames >= 0) {
@@ -147,24 +147,13 @@ Decoder::go ()
while (pass () == false) {
if (_job && !_ignore_length) {
- _job->set_progress (float (_video_frame) / decoding_frames ());
+ _job->set_progress (float (_video_frame) / _fs->dcp_length());
}
}
process_end ();
}
-/** @return Number of frames that we will be decoding */
-int
-Decoder::decoding_frames () const
-{
- if (_opt->num_frames > 0) {
- return _opt->num_frames;
- }
-
- return _fs->length;
-}
-
/** Run one pass. This may or may not generate any actual video / audio data;
* some decoders may require several passes to generate a single frame.
* @return true if we have finished processing all data; otherwise false.
@@ -177,7 +166,7 @@ Decoder::pass ()
_have_setup_video_filters = true;
}
- if (_opt->num_frames != 0 && _video_frame >= _opt->num_frames) {
+ if (_video_frame >= _fs->dcp_length()) {
return true;
}
diff --git a/src/lib/decoder.h b/src/lib/decoder.h
index 19ef25ede..04ff512eb 100644
--- a/src/lib/decoder.h
+++ b/src/lib/decoder.h
@@ -77,8 +77,6 @@ public:
return _video_frame;
}
- int decoding_frames () const;
-
/** Emitted when a video frame is ready.
* First parameter is the frame.
* Second parameter is its index within the content.
diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc
index 6826724af..c03912094 100644
--- a/src/lib/decoder_factory.cc
+++ b/src/lib/decoder_factory.cc
@@ -42,7 +42,7 @@ decoder_factory (
if (fs->content_type() == STILL) {
/* Always ignore length of decodes of stills, since the decoder finishes very quickly
- and its the encoder that takes the time.
+ and it's the encoder that takes the time.
*/
return shared_ptr<Decoder> (new ImageMagickDecoder (fs, o, j, l, minimal, true));
}
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 3471ffaab..767299ea6 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -161,11 +161,37 @@ FFmpegDecoder::do_pass ()
{
int r = av_read_frame (_format_context, &_packet);
if (r < 0) {
+ if (r != AVERROR_EOF) {
+ throw DecodeError ("error on av_read_frame");
+ }
+
+ /* Get any remaining frames */
+
+ _packet.data = 0;
+ _packet.size = 0;
+
+ int frame_finished;
+
+ while (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
+ process_video (_frame);
+ }
+
+ if (_audio_stream >= 0 && _opt->decode_audio) {
+ while (avcodec_decode_audio4 (_audio_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
+ int const data_size = av_samples_get_buffer_size (
+ 0, _audio_codec_context->channels, _frame->nb_samples, audio_sample_format (), 1
+ );
+
+ assert (_audio_codec_context->channels == _fs->audio_channels);
+ process_audio (_frame->data[0], data_size);
+ }
+ }
+
return true;
}
- if (_packet.stream_index == _video_stream && _opt->decode_video) {
-
+ if (_packet.stream_index == _video_stream) {
+
int frame_finished;
if (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
process_video (_frame);
@@ -199,7 +225,13 @@ FFmpegDecoder::length_in_frames () const
float
FFmpegDecoder::frames_per_second () const
{
- return av_q2d (_format_context->streams[_video_stream]->avg_frame_rate);
+ AVStream* s = _format_context->streams[_video_stream];
+
+ if (s->avg_frame_rate.num && s->avg_frame_rate.den) {
+ return av_q2d (s->avg_frame_rate);
+ }
+
+ return av_q2d (s->r_frame_rate);
}
int
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 2db03f6a6..e2b3d4bc3 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -85,8 +85,12 @@ Film::Film (string d, bool must_exist)
_state.directory = result.string ();
- if (must_exist && !filesystem::exists (_state.directory)) {
- throw OpenFileError (_state.directory);
+ if (!filesystem::exists (_state.directory)) {
+ if (must_exist) {
+ throw OpenFileError (_state.directory);
+ } else {
+ filesystem::create_directory (_state.directory);
+ }
}
read_metadata ();
@@ -513,25 +517,22 @@ Film::make_dcp (bool transcode, int freq)
o->out_size = format()->dcp_size ();
if (dcp_frames() == 0) {
/* Decode the whole film, no blacking */
- o->num_frames = 0;
o->black_after = 0;
} else {
switch (dcp_trim_action()) {
case CUT:
/* Decode only part of the film, no blacking */
- o->num_frames = dcp_frames ();
o->black_after = 0;
break;
case BLACK_OUT:
/* Decode the whole film, but black some frames out */
- o->num_frames = 0;
o->black_after = dcp_frames ();
}
}
o->decode_video_frequency = freq;
- o->padding = format()->dcp_padding ();
- o->ratio = format()->ratio_as_float ();
+ o->padding = format()->dcp_padding (this);
+ o->ratio = format()->ratio_as_float (this);
if (transcode) {
if (_state.dcp_ab) {
diff --git a/src/lib/film_state.cc b/src/lib/film_state.cc
index d7d9a1462..3d58a4fec 100644
--- a/src/lib/film_state.cc
+++ b/src/lib/film_state.cc
@@ -283,19 +283,27 @@ FilmState::bytes_per_sample () const
int
FilmState::target_sample_rate () const
{
+ /* Resample to a DCI-approved sample rate */
double t = dcp_audio_sample_rate (audio_sample_rate);
+
+ /* Compensate for the fact that video will be rounded to the
+ nearest integer number of frames per second.
+ */
if (rint (frames_per_second) != frames_per_second) {
- if (fabs (frames_per_second - 23.976) < 1e-6 || (fabs (frames_per_second - 29.97) < 1e-6)) {
- /* 24fps or 30fps drop-frame ie {24,30} * 1000 / 1001 frames per second;
- hence we need to resample the audio to dcp_audio_sample_rate * 1000 / 1001
- so that when we play it back at dcp_audio_sample_rate it is sped up
- by the same amount that the video is
- */
- t *= double(1000) / 1001;
- } else {
- throw EncodeError ("unknown fractional frame rate");
- }
+ t *= frames_per_second / rint (frames_per_second);
}
return rint (t);
}
+
+int
+FilmState::dcp_length () const
+{
+ if (dcp_frames) {
+ return dcp_frames;
+ }
+
+ return length;
+}
+
+
diff --git a/src/lib/film_state.h b/src/lib/film_state.h
index 8dc0ce11b..16a1b0508 100644
--- a/src/lib/film_state.h
+++ b/src/lib/film_state.h
@@ -87,6 +87,8 @@ public:
Size cropped_size (Size) const;
+ int dcp_length () const;
+
/** Complete path to directory containing the film metadata;
must not be relative.
*/
diff --git a/src/lib/format.cc b/src/lib/format.cc
index e689aa05d..aaf5211f9 100644
--- a/src/lib/format.cc
+++ b/src/lib/format.cc
@@ -28,28 +28,15 @@
#include <iomanip>
#include <iostream>
#include "format.h"
+#include "film.h"
using namespace std;
vector<Format const *> Format::_formats;
-/** @param r Ratio multiplied by 100 (e.g. 185)
- * @param dcp Size (in pixels) of the images that we should put in a DCP.
- * @param id ID (e.g. 185)
- * @param n Nick name (e.g. Flat)
- */
-Format::Format (int r, Size dcp, string id, string n)
- : _ratio (r)
- , _dcp_size (dcp)
- , _id (id)
- , _nickname (n)
-{
-
-}
-
/** @return A name to be presented to the user */
string
-Format::name () const
+FixedFormat::name () const
{
stringstream s;
if (!_nickname.empty ()) {
@@ -76,34 +63,18 @@ Format::as_metadata () const
void
Format::setup_formats ()
{
- _formats.push_back (new Format (119, Size (1285, 1080), "119", "1.19"));
- _formats.push_back (new Format (133, Size (1436, 1080), "133", "1.33"));
- _formats.push_back (new Format (138, Size (1485, 1080), "138", "1.375"));
- _formats.push_back (new Format (133, Size (1998, 1080), "133-in-flat", "4:3 within Flat"));
- _formats.push_back (new Format (137, Size (1480, 1080), "137", "Academy"));
- _formats.push_back (new Format (166, Size (1793, 1080), "166", "1.66"));
- _formats.push_back (new Format (166, Size (1998, 1080), "166-in-flat", "1.66 within Flat"));
- _formats.push_back (new Format (178, Size (1998, 1080), "178-in-flat", "16:9 within Flat"));
- _formats.push_back (new Format (185, Size (1998, 1080), "185", "Flat"));
- _formats.push_back (new Format (239, Size (2048, 858), "239", "Scope"));
-}
-
-/** @param r Ratio multiplied by 100.
- * @return Matching Format, or 0.
- */
-Format const *
-Format::from_ratio (int r)
-{
- vector<Format const *>::iterator i = _formats.begin ();
- while (i != _formats.end() && (*i)->ratio_as_integer() != r) {
- ++i;
- }
-
- if (i == _formats.end ()) {
- return 0;
- }
-
- return *i;
+ _formats.push_back (new FixedFormat (119, Size (1285, 1080), "119", "1.19"));
+ _formats.push_back (new FixedFormat (133, Size (1436, 1080), "133", "1.33"));
+ _formats.push_back (new FixedFormat (138, Size (1485, 1080), "138", "1.375"));
+ _formats.push_back (new FixedFormat (133, Size (1998, 1080), "133-in-flat", "4:3 within Flat"));
+ _formats.push_back (new FixedFormat (137, Size (1480, 1080), "137", "Academy"));
+ _formats.push_back (new FixedFormat (166, Size (1793, 1080), "166", "1.66"));
+ _formats.push_back (new FixedFormat (166, Size (1998, 1080), "166-in-flat", "1.66 within Flat"));
+ _formats.push_back (new FixedFormat (178, Size (1998, 1080), "178-in-flat", "16:9 within Flat"));
+ _formats.push_back (new FixedFormat (185, Size (1998, 1080), "185", "Flat"));
+ _formats.push_back (new FixedFormat (239, Size (2048, 858), "239", "Scope"));
+ _formats.push_back (new VariableFormat (Size (1998, 1080), "var-185", "Flat"));
+ _formats.push_back (new VariableFormat (Size (2048, 858), "var-239", "Scope"));
}
/** @param n Nickname.
@@ -152,45 +123,29 @@ Format::from_metadata (string m)
return from_id (m);
}
-/** @param f A Format.
- * @return Index of f within our static list, or -1.
- */
-int
-Format::as_index (Format const * f)
+/** @return All available formats */
+vector<Format const *>
+Format::all ()
{
- vector<Format*>::size_type i = 0;
- while (i < _formats.size() && _formats[i] != f) {
- ++i;
- }
-
- if (i == _formats.size ()) {
- return -1;
- }
-
- return i;
+ return _formats;
}
-/** @param i An index returned from as_index().
- * @return Corresponding Format.
+/** @param r Ratio multiplied by 100 (e.g. 185)
+ * @param dcp Size (in pixels) of the images that we should put in a DCP.
+ * @param id ID (e.g. 185)
+ * @param n Nick name (e.g. Flat)
*/
-Format const *
-Format::from_index (int i)
+FixedFormat::FixedFormat (int r, Size dcp, string id, string n)
+ : Format (dcp, id, n)
+ , _ratio (r)
{
- assert (i >= 0 && i < int(_formats.size ()));
- return _formats[i];
-}
-/** @return All available formats */
-vector<Format const *>
-Format::all ()
-{
- return _formats;
}
int
-Format::dcp_padding () const
+Format::dcp_padding (Film const * f) const
{
- int p = rint ((_dcp_size.width - (_dcp_size.height * _ratio / 100.0)) / 2.0);
+ int p = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0);
/* This comes out -ve for Scope; bodge it */
if (p < 0) {
@@ -199,3 +154,28 @@ Format::dcp_padding () const
return p;
}
+
+VariableFormat::VariableFormat (Size dcp, string id, string n)
+ : Format (dcp, id, n)
+{
+
+}
+
+int
+VariableFormat::ratio_as_integer (Film const * f) const
+{
+ return rint (ratio_as_float (f) * 100);
+}
+
+float
+VariableFormat::ratio_as_float (Film const * f) const
+{
+ return float (f->size().width) / f->size().height;
+}
+
+/** @return A name to be presented to the user */
+string
+VariableFormat::name () const
+{
+ return _nickname;
+}
diff --git a/src/lib/format.h b/src/lib/format.h
index 4b727b2e3..fd6cdbece 100644
--- a/src/lib/format.h
+++ b/src/lib/format.h
@@ -18,7 +18,7 @@
*/
/** @file src/format.h
- * @brief Class to describe a format (aspect ratio) that a Film should
+ * @brief Classes to describe a format (aspect ratio) that a Film should
* be shown in.
*/
@@ -26,26 +26,26 @@
#include <vector>
#include "util.h"
-/** @class Format
- * @brief Class to describe a format (aspect ratio) that a Film should
- * be shown in.
- */
+class Film;
+
class Format
{
public:
- Format (int, Size, std::string, std::string);
+ Format (Size dcp, std::string id, std::string n)
+ : _dcp_size (dcp)
+ , _id (id)
+ , _nickname (n)
+ {}
/** @return the aspect ratio multiplied by 100
* (e.g. 239 for Cinemascope 2.39:1)
*/
- int ratio_as_integer () const {
- return _ratio;
- }
+ virtual int ratio_as_integer (Film const * f) const = 0;
/** @return the ratio as a floating point number */
- float ratio_as_float () const {
- return _ratio / 100.0;
- }
+ virtual float ratio_as_float (Film const * f) const = 0;
+
+ int dcp_padding (Film const * f) const;
/** @return size in pixels of the images that we should
* put in a DCP for this ratio. This size will not correspond
@@ -60,7 +60,7 @@ public:
}
/** @return Full name to present to the user */
- std::string name () const;
+ virtual std::string name () const = 0;
/** @return Nickname (e.g. Flat, Scope) */
std::string nickname () const {
@@ -69,21 +69,13 @@ public:
std::string as_metadata () const;
- int dcp_padding () const;
-
- static Format const * from_ratio (int);
static Format const * from_nickname (std::string n);
static Format const * from_metadata (std::string m);
- static Format const * from_index (int i);
static Format const * from_id (std::string i);
- static int as_index (Format const * f);
static std::vector<Format const *> all ();
static void setup_formats ();
-
-private:
- /** Ratio expressed as the actual ratio multiplied by 100 */
- int _ratio;
+protected:
/** Size in pixels of the images that we should
* put in a DCP for this ratio. This size will not correspond
* to the ratio when we are doing things like 16:9 in a Flat frame.
@@ -94,8 +86,43 @@ private:
/** nickname (e.g. Flat, Scope) */
std::string _nickname;
+private:
/** all available formats */
static std::vector<Format const *> _formats;
};
+/** @class FixedFormat
+ * @brief Class to describe a format whose ratio is fixed regardless
+ * of source size.
+ */
+class FixedFormat : public Format
+{
+public:
+ FixedFormat (int, Size, std::string, std::string);
+
+ int ratio_as_integer (Film const *) const {
+ return _ratio;
+ }
+
+ float ratio_as_float (Film const *) const {
+ return _ratio / 100.0;
+ }
+
+ std::string name () const;
+private:
+
+ /** Ratio expressed as the actual ratio multiplied by 100 */
+ int _ratio;
+};
+
+class VariableFormat : public Format
+{
+public:
+ VariableFormat (Size, std::string, std::string);
+
+ int ratio_as_integer (Film const * f) const;
+ float ratio_as_float (Film const * f) const;
+
+ std::string name () const;
+};
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 620e71aa7..2df7636af 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -94,7 +94,7 @@ Image::scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scal
content_size.width -= (padding * 2);
shared_ptr<RGBFrameImage> rgb (new RGBFrameImage (content_size));
-
+
struct SwsContext* scale_context = sws_getContext (
size().width, size().height, pixel_format(),
content_size.width, content_size.height, PIX_FMT_RGB24,
diff --git a/src/lib/j2k_still_encoder.cc b/src/lib/j2k_still_encoder.cc
index 8f3339a0a..d218d08fe 100644
--- a/src/lib/j2k_still_encoder.cc
+++ b/src/lib/j2k_still_encoder.cc
@@ -17,8 +17,8 @@
*/
-/** @file src/j2k_wav_encoder.cc
- * @brief An encoder which writes JPEG2000 and WAV files.
+/** @file src/j2k_still_encoder.cc
+ * @brief An encoder which writes JPEG2000 files for a single still source image.
*/
#include <sstream>
diff --git a/src/lib/j2k_still_encoder.h b/src/lib/j2k_still_encoder.h
index 755c68877..7a03e1195 100644
--- a/src/lib/j2k_still_encoder.h
+++ b/src/lib/j2k_still_encoder.h
@@ -17,8 +17,8 @@
*/
-/** @file src/j2k_wav_encoder.h
- * @brief An encoder which writes JPEG2000 and WAV files.
+/** @file src/j2k_still_encoder.h
+ * @brief An encoder which writes JPEG2000 files for a single still source image.
*/
#include <list>
diff --git a/src/lib/j2k_wav_encoder.cc b/src/lib/j2k_wav_encoder.cc
index 2f892948d..a1f70a08a 100644
--- a/src/lib/j2k_wav_encoder.cc
+++ b/src/lib/j2k_wav_encoder.cc
@@ -149,7 +149,7 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server)
while (1) {
- TIMING ("encoder thread %1 sleeps", pthread_self ());
+ TIMING ("encoder thread %1 sleeps", boost::this_thread::get_id());
boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty () && !_process_end) {
_worker_condition.wait (lock);
@@ -159,9 +159,9 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server)
return;
}
- TIMING ("encoder thread %1 wakes with queue of %2", pthread_self(), _queue.size());
+ TIMING ("encoder thread %1 wakes with queue of %2", boost::this_thread::get_id(), _queue.size());
boost::shared_ptr<DCPVideoFrame> vf = _queue.front ();
- _log->log (String::compose ("Encoder thread %1 pops frame %2 from queue", pthread_self(), vf->frame()));
+ _log->log (String::compose ("Encoder thread %1 pops frame %2 from queue", boost::this_thread::get_id(), vf->frame()));
_queue.pop_front ();
lock.unlock ();
@@ -193,9 +193,9 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server)
} else {
try {
- TIMING ("encoder thread %1 begins local encode of %2", pthread_self(), vf->frame());
+ TIMING ("encoder thread %1 begins local encode of %2", boost::this_thread::get_id(), vf->frame());
encoded = vf->encode_locally ();
- TIMING ("encoder thread %1 finishes local encode of %2", pthread_self(), vf->frame());
+ TIMING ("encoder thread %1 finishes local encode of %2", boost::this_thread::get_id(), vf->frame());
} catch (std::exception& e) {
_log->log (String::compose ("Local encode failed (%1)", e.what ()));
}
@@ -206,7 +206,7 @@ J2KWAVEncoder::encoder_thread (ServerDescription* server)
frame_done (vf->frame ());
} else {
lock.lock ();
- _log->log (String::compose ("Encoder thread %1 pushes frame %2 back onto queue after failure", pthread_self(), vf->frame()));
+ _log->log (String::compose ("Encoder thread %1 pushes frame %2 back onto queue after failure", boost::this_thread::get_id(), vf->frame()));
_queue.push_front (vf);
lock.unlock ();
}
diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc
index a166b5924..76fcc6c5d 100644
--- a/src/lib/job_manager.cc
+++ b/src/lib/job_manager.cc
@@ -73,6 +73,20 @@ JobManager::work_to_do () const
return i != _jobs.end ();
}
+bool
+JobManager::errors () const
+{
+ boost::mutex::scoped_lock lm (_mutex);
+ for (list<shared_ptr<Job> >::const_iterator i = _jobs.begin(); i != _jobs.end(); ++i) {
+ if ((*i)->finished_in_error ()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
void
JobManager::scheduler ()
{
diff --git a/src/lib/job_manager.h b/src/lib/job_manager.h
index d1d33cfc2..8b79fd67d 100644
--- a/src/lib/job_manager.h
+++ b/src/lib/job_manager.h
@@ -41,6 +41,7 @@ public:
void add_after (boost::shared_ptr<Job> after, boost::shared_ptr<Job> j);
std::list<boost::shared_ptr<Job> > get () const;
bool work_to_do () const;
+ bool errors () const;
static JobManager* instance ();
diff --git a/src/lib/options.h b/src/lib/options.h
index b283e330d..39068c24f 100644
--- a/src/lib/options.h
+++ b/src/lib/options.h
@@ -39,8 +39,7 @@ public:
Options (std::string f, std::string e, std::string m)
: padding (0)
, apply_crop (true)
- , num_frames (0)
- , decode_video (true)
+ , black_after (0)
, decode_video_frequency (0)
, decode_audio (true)
, _frame_out_path (f)
@@ -93,9 +92,7 @@ public:
float ratio; ///< ratio of the wanted output image (not considering padding)
int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
bool apply_crop; ///< true to apply cropping
- int num_frames; ///< number of video frames to run for, or 0 for all
int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none
- bool decode_video; ///< true to decode video, otherwise false
int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails)
bool decode_audio; ///< true to decode audio, otherwise false
diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc
index e79be09fe..e1ba82359 100644
--- a/src/lib/transcode_job.cc
+++ b/src/lib/transcode_job.cc
@@ -107,5 +107,5 @@ TranscodeJob::remaining_time () const
return 0;
}
- return ((_fs->length - _encoder->last_frame()) / fps);
+ return ((_fs->dcp_length() - _encoder->last_frame()) / fps);
}