summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-30 23:27:19 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-30 23:27:19 +0100
commite6dd32ca6a32f364dafd99b0fe4bbb6119afb9d7 (patch)
tree59ac988625476d038554166967a867ffe8330743 /src/lib
parent288154d38df73021dd4a65327ab588c8a6590960 (diff)
parentf8cf5bfe56cc3522f281555c4b04d77b15cf1a2d (diff)
Merg..
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cross.cc31
-rw-r--r--src/lib/cross.h3
-rw-r--r--src/lib/film.cc16
3 files changed, 46 insertions, 4 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index ff0d9f7d1..86b657432 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -22,8 +22,9 @@
#include "cross.h"
#include "compose.hpp"
#include "log.h"
-#ifdef DVDOMATIC_POSIX
+#ifdef DVDOMATIC_LINUX
#include <unistd.h>
+#include <mntent.h>
#endif
#ifdef DVDOMATIC_WINDOWS
#include <windows.h>
@@ -35,8 +36,10 @@
#endif
using std::pair;
+using std::list;
using std::ifstream;
using std::string;
+using std::make_pair;
using boost::shared_ptr;
void
@@ -156,3 +159,29 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
system (ffprobe.c_str ());
#endif
}
+
+list<pair<string, string> >
+mount_info ()
+{
+ list<pair<string, string> > m;
+
+#ifdef DVDOMATIC_LINUX
+ FILE* f = setmntent ("/etc/mtab", "r");
+ if (!f) {
+ return m;
+ }
+
+ while (1) {
+ struct mntent* mnt = getmntent (f);
+ if (!mnt) {
+ break;
+ }
+
+ m.push_back (make_pair (mnt->mnt_dir, mnt->mnt_type));
+ }
+
+ endmntent (f);
+#endif
+
+ return m;
+}
diff --git a/src/lib/cross.h b/src/lib/cross.h
index 1a7a8cb4d..d9cc2d12f 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -26,6 +26,7 @@ class Log;
#define WEXITSTATUS(w) (w)
#endif
-void dvdomatic_sleep (int);
+extern void dvdomatic_sleep (int);
extern std::pair<std::string, int> cpu_info ();
extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
+extern std::list<std::pair<std::string, std::string> > mount_info ();
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 827c62082..217673a7f 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -68,6 +68,7 @@ using std::setfill;
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;
@@ -142,13 +143,13 @@ Film::Film (string d, bool must_exist)
_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)
@@ -317,6 +318,11 @@ Film::make_dcp ()
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
@@ -329,6 +335,10 @@ Film::make_dcp ()
#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"));
@@ -684,6 +694,8 @@ Film::read_metadata ()
}
_dirty = false;
+
+ _log->log (String::compose ("Loaded film with use_content_audio = %1", use_content_audio ()));
}
libdcp::Size