_picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0);
- if (_film->audio_channels() > 0) {
+ AudioMapping m (_film->audio_channels ());
+
+ if (m.dcp_channels() > 0) {
_sound_asset.reset (
new libdcp::SoundAsset (
_film->dir (_film->dcp_name()),
"audio.mxf",
DCPFrameRate (_film->frames_per_second()).frames_per_second,
- _film->audio_channels(),
+ m.dcp_channels (),
dcp_audio_sample_rate (_film->audio_stream()->sample_rate())
)
);
_sound_asset_writer = _sound_asset->start_write ();
}
-
+
_thread = new boost::thread (boost::bind (&Writer::thread, this));
}
void
Writer::thread ()
+try
{
while (1)
{
--_queued_full_in_memory;
}
}
-
+}
+catch (...)
+{
+ store_current ();
}
void
lock.unlock ();
_thread->join ();
+ if (thrown ()) {
+ rethrow ();
+ }
+
delete _thread;
_thread = 0;
return (frame != 0 && frame < _first_nonexistant_frame);
}
-
bool
operator< (QueueItem const & a, QueueItem const & b)
{