#include "audio_decoder.h"
#include "sndfile_decoder.h"
#include "analyse_audio_job.h"
+#include "cross.h"
#include "i18n.h"
using std::min;
using std::make_pair;
using std::endl;
+using std::list;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::to_upper_copy;
, _j2k_bandwidth (200000000)
, _dci_metadata (Config::instance()->default_dci_metadata ())
, _dcp_frame_rate (0)
+ , _minimum_audio_channels (0)
, _source_frame_rate (0)
, _dirty (false)
{
_sndfile_stream = SndfileStream::create ();
+ _log.reset (new FileLog (file ("log")));
+
if (must_exist) {
read_metadata ();
} else {
write_metadata ();
}
-
- _log.reset (new FileLog (file ("log")));
}
Film::Film (Film const & o)
, _dci_metadata (o._dci_metadata)
, _dci_date (o._dci_date)
, _dcp_frame_rate (o._dcp_frame_rate)
+ , _minimum_audio_channels (o._minimum_audio_channels)
, _size (o._size)
, _length (o._length)
, _content_digest (o._content_digest)
string
Film::internal_video_mxf_dir () const
{
- boost::filesystem::path p;
return dir ("video");
}
log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate()));
log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads()));
log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth()));
+ if (use_content_audio()) {
+ log()->log ("Using content's audio");
+ } else {
+ log()->log (String::compose ("Using external audio (%1 files)", external_audio().size()));
+ }
#ifdef DVDOMATIC_DEBUG
log()->log ("DVD-o-matic built in debug mode.");
#else
#endif
pair<string, int> const c = cpu_info ();
log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
+ list<pair<string, string> > const m = mount_info ();
+ for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
+ log()->log (String::compose ("Mount: %1 %2", i->first, i->second));
+ }
if (format() == 0) {
throw MissingSettingError (_("format"));
_dci_metadata.write (f);
f << "dci_date " << boost::gregorian::to_iso_string (_dci_date) << endl;
f << "dcp_frame_rate " << _dcp_frame_rate << endl;
+ f << "minimum_audio_channels " << _minimum_audio_channels << endl;
f << "width " << _size.width << endl;
f << "height " << _size.height << endl;
f << "length " << _length.get_value_or(0) << endl;
_dci_date = boost::gregorian::from_undelimited_string (v);
} else if (k == "dcp_frame_rate") {
_dcp_frame_rate = atoi (v.c_str ());
+ } else if (k == "minimum_audio_channels") {
+ _minimum_audio_channels = atoi (v.c_str ());
}
_dci_metadata.read (k, v);
_content = c;
}
+ /* Do this before we start using FFmpeg ourselves */
+ run_ffprobe (c, file ("ffprobe.log"), _log);
+
/* Reset streams here in case the new content doesn't have one or the other */
_content_audio_stream = shared_ptr<AudioStream> ();
_subtitle_stream = shared_ptr<SubtitleStream> ();
signal_changed (DCP_FRAME_RATE);
}
+void
+Film::set_minimum_audio_channels (int c)
+{
+ {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ _minimum_audio_channels = c;
+ }
+ signal_changed (MINIMUM_AUDIO_CHANNELS);
+}
+
void
Film::set_size (libdcp::Size s)
{