More player debugging for butler video-full states. v2.13.121
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Feb 2019 22:00:18 +0000 (22:00 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Feb 2019 22:00:18 +0000 (22:00 +0000)
src/lib/dcpomatic_log.h
src/lib/file_log.cc
src/lib/file_log.h
src/lib/log_entry.cc
src/lib/log_entry.h
src/tools/dcpomatic.cc
src/tools/dcpomatic_player.cc
src/wx/film_viewer.cc

index 88d031fc7a109d3854449f3320ff1a39a4c711f1..2cec0c40558a23661c0c01215ad9b20c274a6de6 100644 (file)
@@ -33,3 +33,4 @@ extern boost::shared_ptr<Log> dcpomatic_log;
 #define LOG_WARNING_NC(...)   dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_WARNING);
 #define LOG_TIMING(...)       dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_TIMING);
 #define LOG_DEBUG_ENCODE(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
+#define LOG_DEBUG_PLAYER(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_PLAYER);
index be532c10fb648adab268b13c6d3c2401b5d72aae..f6eaa58f8ebaf85b4e02630fee9ab869f91115c2 100644 (file)
@@ -33,14 +33,7 @@ using boost::shared_ptr;
 FileLog::FileLog (boost::filesystem::path file)
        : _file (file)
 {
-       _config_connection = Config::instance()->Changed.connect (boost::bind (&FileLog::config_changed, this));
-       config_changed ();
-}
-
-void
-FileLog::config_changed ()
-{
-       set_types (Config::instance()->log_types ());
+       set_types (Config::instance()->log_types());
 }
 
 void
index 83f3696095cd7d48cf8529c3bbf9c52f2b59e6cf..53fbe4f765308a391a0cf1c591b323c960f255b8 100644 (file)
@@ -29,9 +29,7 @@ public:
 
 private:
        void do_log (boost::shared_ptr<const LogEntry> entry);
-       void config_changed ();
 
        /** filename to write to */
        boost::filesystem::path _file;
-       boost::signals2::scoped_connection _config_connection;
 };
index 8a665481154705638b421dce066b29753de40670..6a36c3383aa5d575ef85ca7020dc0cc992deba7d 100644 (file)
@@ -31,6 +31,7 @@ int const LogEntry::TYPE_DEBUG_DECODE = 0x8;
 int const LogEntry::TYPE_DEBUG_ENCODE = 0x10;
 int const LogEntry::TYPE_TIMING       = 0x20;
 int const LogEntry::TYPE_DEBUG_EMAIL  = 0x40;
+int const LogEntry::TYPE_DEBUG_PLAYER = 0x80;
 
 using std::string;
 
index 3d6a9f371990387e8c1d5bc8f7eb6399a3c9a4a9..50bbf63a09d9516761c9e272d3ea958e4ddcd230 100644 (file)
@@ -35,6 +35,7 @@ public:
        static const int TYPE_DEBUG_ENCODE;
        static const int TYPE_TIMING;
        static const int TYPE_DEBUG_EMAIL;
+       static const int TYPE_DEBUG_PLAYER;
 
        explicit LogEntry (int type);
        virtual ~LogEntry () {}
index af48c6bbfa1167041a91424a55700fde00cbb084..4505cff84cfea5b8e7fb91cc554310dedda39f2e 100644 (file)
@@ -1343,6 +1343,8 @@ private:
                }
 
                _history_items = history.size ();
+
+               dcpomatic_log->set_types (Config::instance()->log_types());
        }
 
        void update_checker_state_changed ()
index 1cc53dafba2f6cf9aa95c52e39208f8576dab7dd..6e4f9960c167feb5d71db5ccd258b5d26dce2829 100644 (file)
@@ -869,7 +869,7 @@ private:
                        } else {
                                dcpomatic_log.reset (new NullLog());
                        }
-                       dcpomatic_log->set_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+                       dcpomatic_log->set_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR | LogEntry::TYPE_DEBUG_PLAYER);
                }
        }
 
index b5e60f60e09a27e0d6286bb43a66e87eefb7477f..0e47ac1acb47947da199f71430e03d2657c70e07 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -44,6 +44,7 @@
 #include "lib/log.h"
 #include "lib/config.h"
 #include "lib/compose.hpp"
+#include "lib/dcpomatic_log.h"
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
@@ -304,6 +305,7 @@ FilmViewer::timer ()
                return;
        }
 
+       LOG_DEBUG_PLAYER("%1 -> %2; delay %3", next.seconds(), time().seconds(), max((next.seconds() - time().seconds()) * 1000, 1.0));
        _timer.Start (max ((next.seconds() - time().seconds()) * 1000, 1.0), wxTIMER_ONE_SHOT);
 
        if (_butler) {