summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-11 18:59:26 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-11 18:59:26 +0000
commit7e2cf1a4a04828b5a57d5eb6869475a819005602 (patch)
tree5f54f76d49614266b6f913cce38a76bd98c87762
parent3af978d2d688cb1e4be7c8d95155a6b8cc7456a3 (diff)
parentd37c1c35b36a28a3e3bbec6c21721f16f8e4aa48 (diff)
Merge branch 'master' into subtitle-content
-rw-r--r--ChangeLog13
-rw-r--r--debian/changelog6
-rw-r--r--src/lib/encoder.cc3
-rw-r--r--src/lib/transcode_job.cc9
-rw-r--r--src/lib/writer.cc46
-rw-r--r--src/lib/writer.h2
-rw-r--r--wscript2
7 files changed, 48 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index e9f513921..0a353e57a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2014-01-11 Carl Hetherington <cth@carlh.net>
+
+ * Hopefully fix error on restarting a cancelled transcode job
+ on Windows.
+
+2014-01-10 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.62.2 released.
+
+2014-01-10 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.62.1 released.
+
2014-01-10 Carl Hetherington <cth@carlh.net>
* Version 1.62.0 released.
diff --git a/debian/changelog b/debian/changelog
index b4efe501f..5181ae932 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-dcpomatic (1.62.0-1) UNRELEASED; urgency=low
+dcpomatic (1.62.2-1) UNRELEASED; urgency=low
* New upstream release.
* New upstream release.
@@ -68,8 +68,10 @@ dcpomatic (1.62.0-1) UNRELEASED; urgency=low
* New upstream release.
* New upstream release.
* New upstream release.
+ * New upstream release.
+ * New upstream release.
- -- Carl Hetherington <carl@d1stkfactory> Fri, 10 Jan 2014 10:30:28 +0000
+ -- Carl Hetherington <carl@d1stkfactory> Fri, 10 Jan 2014 14:14:09 +0000
dcpomatic (0.87-1) UNRELEASED; urgency=low
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc
index b78bcaeea..fbec3e4d0 100644
--- a/src/lib/encoder.cc
+++ b/src/lib/encoder.cc
@@ -68,9 +68,6 @@ Encoder::Encoder (shared_ptr<const Film> f, weak_ptr<Job> j)
Encoder::~Encoder ()
{
terminate_threads ();
- if (_writer) {
- _writer->finish ();
- }
}
/** Add a worker thread for a each thread on a remote server. Caller must hold
diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc
index fd69b08e7..87fd5daef 100644
--- a/src/lib/transcode_job.cc
+++ b/src/lib/transcode_job.cc
@@ -64,12 +64,11 @@ TranscodeJob::run ()
_film->log()->log (N_("Transcode job completed successfully"));
- } catch (std::exception& e) {
-
+ } catch (...) {
set_progress (1);
set_state (FINISHED_ERROR);
- _film->log()->log (String::compose (N_("Transcode job failed (%1)"), e.what()));
-
+ _film->log()->log (N_("Transcode job failed or cancelled"));
+ _transcoder.reset ();
throw;
}
}
@@ -78,7 +77,7 @@ string
TranscodeJob::status () const
{
if (!_transcoder) {
- return _("0%");
+ return Job::status ();
}
float const fps = _transcoder->current_encoding_rate ();
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 558eda97e..572a1c3a4 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -45,6 +45,7 @@ using std::pair;
using std::string;
using std::list;
using std::cout;
+using std::stringstream;
using boost::shared_ptr;
using boost::weak_ptr;
@@ -91,21 +92,6 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
_picture_asset->set_key (_film->key ());
}
- /* Write the sound asset into the film directory so that we leave the creation
- of the DCP directory until the last minute. Some versions of windows inexplicably
- don't like overwriting existing files here, so try to remove it using boost.
- */
- boost::system::error_code ec;
- boost::filesystem::remove_all (_film->file (_film->audio_mxf_filename ()), ec);
- if (ec) {
- _film->log()->log (
- String::compose (
- "Could not remove existing audio MXF file %1 (%2)",
- _film->file (_film->audio_mxf_filename ()),
- ec.value ())
- );
- }
-
_picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0);
_sound_asset.reset (new libdcp::SoundAsset (_film->directory (), _film->audio_mxf_filename ()));
@@ -117,6 +103,9 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
_sound_asset->set_key (_film->key ());
}
+ /* Write the sound asset into the film directory so that we leave the creation
+ of the DCP directory until the last minute.
+ */
_sound_asset_writer = _sound_asset->start_write ();
_thread = new boost::thread (boost::bind (&Writer::thread, this));
@@ -124,6 +113,11 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
job->sub (_("Encoding image data"));
}
+Writer::~Writer ()
+{
+ terminate_thread (false);
+}
+
void
Writer::write (shared_ptr<const EncodedData> encoded, int frame, Eyes eyes)
{
@@ -347,23 +341,31 @@ catch (...)
}
void
-Writer::finish ()
+Writer::terminate_thread (bool can_throw)
{
- if (!_thread) {
- return;
- }
-
boost::mutex::scoped_lock lock (_mutex);
_finish = true;
_empty_condition.notify_all ();
_full_condition.notify_all ();
lock.unlock ();
- _thread->join ();
- rethrow ();
+ _thread->join ();
+ if (can_throw) {
+ rethrow ();
+ }
delete _thread;
_thread = 0;
+}
+
+void
+Writer::finish ()
+{
+ if (!_thread) {
+ return;
+ }
+
+ terminate_thread (true);
_picture_asset_writer->finalize ();
_sound_asset_writer->finalize ();
diff --git a/src/lib/writer.h b/src/lib/writer.h
index e2807d712..7af79a417 100644
--- a/src/lib/writer.h
+++ b/src/lib/writer.h
@@ -71,6 +71,7 @@ class Writer : public ExceptionStore, public boost::noncopyable
{
public:
Writer (boost::shared_ptr<const Film>, boost::weak_ptr<Job>);
+ ~Writer ();
bool can_fake_write (int) const;
@@ -83,6 +84,7 @@ public:
private:
void thread ();
+ void terminate_thread (bool);
void check_existing_picture_mxf ();
bool check_existing_picture_mxf_frame (FILE *, int, Eyes);
bool have_sequenced_image_at_queue_head ();
diff --git a/wscript b/wscript
index ce55833e2..7baba5468 100644
--- a/wscript
+++ b/wscript
@@ -3,7 +3,7 @@ import os
import sys
APPNAME = 'dcpomatic'
-VERSION = '1.62.0devel'
+VERSION = '1.62.2devel'
def options(opt):
opt.load('compiler_cxx')