|
From: Daniel Caujolle-B. <seg...@cl...> - 2003-06-09 21:00:33
|
Re,
To have a small idea of the change, here is a small sample:
RCS file: /export/cvsroot/xine-lib/include/xine.h.in,v
retrieving revision 1.13
diff -u -r1.13 xine.h.in
--- include/xine.h.in 1 Jun 2003 20:47:58 -0000 1.13
+++ include/xine.h.in 9 Jun 2003 01:30:32 -0000
@@ -341,11 +341,11 @@
#define XINE_DEMUX_EXTENSION_STRATEGY 3
/* verbosity settings */
-#define XINE_VERBOSITY_NONE 0
-#define XINE_VERBOSITY_LOG 1
-#define XINE_VERBOSITY_DEBUG 2
+#define XINE_VERBOSITY_NONE 0x000000
+#define XINE_VERBOSITY_LOG 0x000001
+#define XINE_VERBOSITY_DEBUG 0x000002
/*
* snapshot function
Index: src/xine-engine/xine_internal.h
===================================================================
RCS file: /export/cvsroot/xine-lib/src/xine-engine/xine_internal.h,v
retrieving revision 1.6
diff -u -r1.6 xine_internal.h
--- src/xine-engine/xine_internal.h 21 May 2003 21:21:23 -0000 1.6
+++ src/xine-engine/xine_internal.h 9 Jun 2003 01:30:38 -0000
@@ -89,6 +89,47 @@
#define XINE_STREAM_INFO_MAX 99
+#ifdef __GNUC__
+#define xprintf(xine, verbose, fmt, args...) \
+ do { \
+ if((xine)->verbosity & verbose) \
+ printf(fmt, ##args); \
+ } while(0)
+#else
+#define xprintf(xine, verbose, fmt, ...) \
+ do { \
+ if((xine)->verbosity & verbose) \
+ printf(fmt, __VA_ARGS__); \
+ } while(0)
+#endif
+
+/* Only print if LOG is defined */
+
+#ifdef LOG
+
+#ifdef __GNUC__
+#define lprintf(fmt, args...) \
+ do { \
+ printf(fmt, ##args); \
+ } while(0)
+#else
+#define lprintf(fmt, ...) \
+ do { \
+ printf(fmt, __VA_ARGS__); \
+ } while(0)
+#endif
+
+#else /* LOG */
+
+#ifdef __GNUC__
+#define lprintf(fmt, args...) ;
+#else
+#define lprintf(fmt, ...) ;
+#endif
+
+#endif
+
+
/*
* the "big" xine struct, holding everything together
*/
-------------------------------------------------------
Patch overview:
- if (this->class->xine->verbosity >= XINE_VERBOSITY_LOG)
- printf ("audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume);
+ xprintf(this->class->xine, XINE_VERBOSITY_LOG,
+ "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume);
-#ifdef LOG
- printf ("audio_oss_out: %d bytes output\n", info.bytes);
-#endif
+ lprintf ("audio_oss_out: %d bytes output\n", info.bytes);
--
73's de Daniel, F1RMB.
-=- Daniel Caujolle-Bert -=- seg...@cl... -=-
-=- http://naboo.homelinux.org -=-
|