Encoder::process_end ()
{
#if HAVE_SWRESAMPLE
- if (_film->has_audio() && _film->audio_channels() && _swr_context) {
+ if (_film->has_audio() && _swr_context) {
- shared_ptr<AudioBuffers> out (new AudioBuffers (_film->audio_channels(), 256));
+ shared_ptr<AudioBuffers> out (new AudioBuffers (_film->audio_mapping().dcp_channels(), 256));
while (1) {
int const frames = swr_convert (_swr_context, (uint8_t **) out->data(), 256, 0, 0);
/* Compute the resampled frames count and add 32 for luck */
int const max_resampled_frames = ceil ((int64_t) data->frames() * _film->target_audio_sample_rate() / _film->audio_frame_rate()) + 32;
- shared_ptr<AudioBuffers> resampled (new AudioBuffers (_film->audio_channels(), max_resampled_frames));
+ shared_ptr<AudioBuffers> resampled (new AudioBuffers (_film->audio_mapping().dcp_channels(), max_resampled_frames));
/* Resample audio */
int const resampled_frames = swr_convert (
}
if (remote_backoff > 0) {
- dvdomatic_sleep (remote_backoff);
+ dcpomatic_sleep (remote_backoff);
}
lock.lock ();
set_state (FINISHED_ERROR);
string m = String::compose (_("An error occurred whilst handling the file %1."), boost::filesystem::path (e.filename()).leaf());
-
- boost::filesystem::space_info const s = boost::filesystem::space (e.filename());
- if (s.available < pow (1024, 3)) {
- m += N_("\n\n");
- m += _("The drive that the film is stored on is low in disc space. Free some more space and try again.");
+
+ try {
+ boost::filesystem::space_info const s = boost::filesystem::space (e.filename());
+ if (s.available < pow (1024, 3)) {
+ m += N_("\n\n");
+ m += _("The drive that the film is stored on is low in disc space. Free some more space and try again.");
+ }
+ } catch (...) {
+
}
set_error (e.what(), m);
set_state (FINISHED_ERROR);
set_error (
e.what (),
- _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)")
+ _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)")
);
} catch (...) {
set_state (FINISHED_ERROR);
set_error (
_("Unknown error"),
- _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)")
+ _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)")
);
}
*/
- #ifndef DVDOMATIC_PLAYER_H
- #define DVDOMATIC_PLAYER_H
+ #ifndef DCPOMATIC_PLAYER_H
+ #define DCPOMATIC_PLAYER_H
#include <list>
#include <boost/shared_ptr.hpp>
std::list<boost::shared_ptr<VideoDecoder> >::iterator _video_decoder;
std::list<boost::shared_ptr<SndfileDecoder> > _sndfile_decoders;
- boost::shared_ptr<AudioBuffers> _sndfile_buffers;
+ boost::shared_ptr<AudioBuffers> _audio_buffers;
bool _video_sync;
};