diff --git a/headers/private/media/debug.h b/headers/private/media/debug.h index 4ebbc35f6a..4f4041e3a6 100644 --- a/headers/private/media/debug.h +++ b/headers/private/media/debug.h @@ -1,27 +1,25 @@ #ifndef _MEDIA_DEBUG_H_ #define _MEDIA_DEBUG_H_ +#ifndef DEBUG + #define DEBUG 0 +#endif + #include #include #undef TRACE #undef PRINT -#ifndef DEBUG - #define DEBUG -1 -#endif +#if DEBUG > 0 -#ifndef NDEBUG + #define UNIMPLEMENTED() printf("UNIMPLEMENTED %s\n",__PRETTY_FUNCTION__) + inline void ERROR(const char *fmt, ...) { va_list ap; va_start(ap, fmt); printf("### ERROR: "); vprintf(fmt, ap); va_end(ap); } + inline void PRINT(int level, const char *fmt, ...) { va_list ap; if (level > DEBUG) return; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); } - #if DEBUG >= 1 - #define UNIMPLEMENTED() printf("UNIMPLEMENTED %s\n",__PRETTY_FUNCTION__) - inline void ERROR(const char *fmt, ...) { va_list ap; va_start(ap, fmt); printf("### ERROR: "); vprintf(fmt, ap); va_end(ap); } - inline void PRINT(int level, const char *fmt, ...) { va_list ap; if (level > DEBUG) return; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); } - #else - #define UNIMPLEMENTED() ((void)0) - #define ERROR(a...) ((void)0) - #define PRINT(l, a...) ((void)0) - #endif + #define PRINT_FORMAT(_text, _fmt) do { char _buf[300]; string_for_format((_fmt), _buf, sizeof(_buf)); printf("%s %s\n", (_text), (_buf)); } while (0) + #define PRINT_INPUT(_text, _in) do { char _buf[300]; string_for_format((_in).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_in).node.node, (_in).node.port, (_in).source.port, (_in).source.id, (_in).destination.port, (_in).destination.id, _buf, (_in).name); } while (0) + #define PRINT_OUTPUT(_text, _out) do { char _buf[300]; string_for_format((_out).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_out).node.node, (_out).node.port, (_out).source.port, (_out).source.id, (_out).destination.port, (_out).destination.id, _buf, (_out).name); } while (0) #if DEBUG >= 2 #define BROKEN() printf("BROKEN %s\n",__PRETTY_FUNCTION__) @@ -37,16 +35,6 @@ #define CALLED() ((void)0) #endif - #if DEBUG >= 1 - #define PRINT_FORMAT(_text, _fmt) do { char _buf[300]; string_for_format((_fmt), _buf, sizeof(_buf)); printf("%s %s\n", (_text), (_buf)); } while (0) - #define PRINT_INPUT(_text, _in) do { char _buf[300]; string_for_format((_in).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_in).node.node, (_in).node.port, (_in).source.port, (_in).source.id, (_in).destination.port, (_in).destination.id, _buf, (_in).name); } while (0) - #define PRINT_OUTPUT(_text, _out) do { char _buf[300]; string_for_format((_out).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_out).node.node, (_out).node.port, (_out).source.port, (_out).source.id, (_out).destination.port, (_out).destination.id, _buf, (_out).name); } while (0) - #else - #define PRINT_FORMAT(_text, _fmt) ((void)0) - #define PRINT_INPUT(_text, _in) ((void)0) - #define PRINT_OUTPUT(_text, _out) ((void)0) - #endif - #else #define PRINT_FORMAT(_text, _fmt) ((void)0) diff --git a/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp b/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp index bfaff58b32..3b2f3b96de 100644 --- a/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp +++ b/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp @@ -1686,9 +1686,7 @@ AudioMixer::UpdateParameterWeb() group->MakeNullParameter(PARAM_ETC(1002), B_MEDIA_RAW_AUDIO, "Haiku audio mixer", B_GENERIC); group->MakeNullParameter(PARAM_ETC(1003), B_MEDIA_RAW_AUDIO, "Version: " VERSION_STRING , B_GENERIC); group->MakeNullParameter(PARAM_ETC(1004), B_MEDIA_RAW_AUDIO, "Build: " BUILD_STRING - #if DEBUG == 0 - ", optimization disabled" - #elif DEBUG > 0 + #if DEBUG ", debugging enabled" #endif , B_GENERIC); diff --git a/src/kits/media/TimedEventQueue.cpp b/src/kits/media/TimedEventQueue.cpp index 2711f9dfea..cf270cea81 100644 --- a/src/kits/media/TimedEventQueue.cpp +++ b/src/kits/media/TimedEventQueue.cpp @@ -4,7 +4,6 @@ * DESCR: used by BMediaEventLooper ***********************************************************************/ -#define NDEBUG #include #include #include "TimedEventQueuePrivate.h"