Merge master.
[dcpomatic.git] / src / lib / util.cc
index e1bc560c613e9fc21267435255d5b93e7edb89ef..eda0d0236767300f349c146660d29a1f24a24595 100644 (file)
@@ -56,13 +56,12 @@ extern "C" {
 #include "util.h"
 #include "exceptions.h"
 #include "scaler.h"
-#include "format.h"
 #include "dcp_content_type.h"
 #include "filter.h"
 #include "sound_processor.h"
 #include "config.h"
-#include "container.h"
-#ifdef DVDOMATIC_WINDOWS
+#include "ratio.h"
+#ifdef DCPOMATIC_WINDOWS
 #include "stack.hpp"
 #endif
 
@@ -261,7 +260,7 @@ seconds (struct timeval t)
        return t.tv_sec + (double (t.tv_usec) / 1e6);
 }
 
-#ifdef DVDOMATIC_WINDOWS
+#ifdef DCPOMATIC_WINDOWS
 LONG WINAPI exception_handler(struct _EXCEPTION_POINTERS *)
 {
        dbg::stack s;
@@ -277,7 +276,7 @@ LONG WINAPI exception_handler(struct _EXCEPTION_POINTERS *)
 void
 dcpomatic_setup ()
 {
-#ifdef DVDOMATIC_WINDOWS
+#ifdef DCPOMATIC_WINDOWS
        backtrace_file /= g_get_user_config_dir ();
        backtrace_file /= "backtrace.txt";
        SetUnhandledExceptionFilter(exception_handler);
@@ -285,8 +284,7 @@ dcpomatic_setup ()
        
        avfilter_register_all ();
        
-       Format::setup_formats ();
-       Container::setup_containers ();
+       Ratio::setup_ratios ();
        DCPContentType::setup_dcp_content_types ();
        Scaler::setup_scalers ();
        Filter::setup_filters ();
@@ -717,32 +715,6 @@ video_frames_to_audio_frames (ContentVideoFrame v, float audio_sample_rate, floa
        return ((int64_t) v * audio_sample_rate / frames_per_second);
 }
 
-/** @return A pair containing CPU model name and the number of processors */
-pair<string, int>
-cpu_info ()
-{
-       pair<string, int> info;
-       info.second = 0;
-       
-#ifdef DCPOMATIC_POSIX
-       ifstream f (N_("/proc/cpuinfo"));
-       while (f.good ()) {
-               string l;
-               getline (f, l);
-               if (boost::algorithm::starts_with (l, N_("model name"))) {
-                       string::size_type const c = l.find (':');
-                       if (c != string::npos) {
-                               info.first = l.substr (c + 2);
-                       }
-               } else if (boost::algorithm::starts_with (l, N_("processor"))) {
-                       ++info.second;
-               }
-       }
-#endif 
-
-       return info;
-}
-
 string
 audio_channel_name (int c)
 {