pthread_mutex_t ffmpeg_lock;
static int log_stderr;
static int log_decorate;
+int log_debug;
static void
handle_sigpipe(int x)
" it will allow world-wide administrative access\n"
" to your Tvheadend installation until you edit\n"
" the access-control from within the Tvheadend UI\n");
+ printf(" -d Debug logging");
printf("\n");
printf("For more information read the man page or visit\n");
printf(" http://www.lonelycoder.com/hts/\n");
const char *contentpath = TVHEADEND_CONTENT_PATH;
const char *homedir = NULL;
- while((c = getopt(argc, argv, "fu:g:c:Ch")) != -1) {
+ while((c = getopt(argc, argv, "fu:g:c:Chd")) != -1) {
switch(c) {
case 'f':
forkaway = 1;
case 'c':
contentpath = optarg;
break;
+ case 'd':
+ log_debug = 1;
+ break;
case 'C':
createdefault = 1;
break;
#define LOG_INFO 6 /* informational */
#define LOG_DEBUG 7 /* debug-level messages */
+extern int log_debug;
+
+#define DEBUGLOG(subsys, fmt...) do { \
+ if(log_debug) \
+ tvhlog(LOG_DEBUG, subsys, fmt); \
+} while(0)
+
static inline int64_t
getclock_hires(void)