summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/transcode_job.cc9
-rw-r--r--src/tools/dcpomatic.cc4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc
index f0e22da64..5c195ee1b 100644
--- a/src/lib/transcode_job.cc
+++ b/src/lib/transcode_job.cc
@@ -100,17 +100,20 @@ TranscodeJob::status () const
int
TranscodeJob::remaining_time () const
{
- if (!_transcoder) {
+ /* _transcoder might be destroyed by the job-runner thread */
+ shared_ptr<Transcoder> t = _transcoder;
+
+ if (!t) {
return 0;
}
- float fps = _transcoder->current_encoding_rate ();
+ float fps = t->current_encoding_rate ();
if (fps == 0) {
return 0;
}
/* Compute approximate proposed length here, as it's only here that we need it */
- OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - _transcoder->video_frames_out();
+ OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - t->video_frames_out();
return left / fps;
}
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1e60d9690..70e675e40 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -474,8 +474,10 @@ private:
shared_ptr<Job> (new SendKDMEmailJob (film, d->screens (), d->dcp (), d->from (), d->until ()))
);
}
- } catch (KDMError& e) {
+ } catch (exception& e) {
error_dialog (this, e.what ());
+ } catch (...) {
+ error_dialog (this, _("An unknown exeception occurred."));
}
d->Destroy ();