Reverse NDEBUG conditions

By default, these specific debug logs are disabled.

Make the ifdef condition less confusing.
This commit is contained in:
Romain Vimont 2024-09-11 11:29:00 +02:00
parent 33a8c39beb
commit 63ced79842
4 changed files with 11 additions and 11 deletions

View File

@ -5,7 +5,7 @@
#include "util/log.h"
#define SC_AUDIO_PLAYER_NDEBUG // comment to debug
//#define SC_AUDIO_PLAYER_DEBUG // uncomment to debug
/**
* Real-time audio player with configurable latency
@ -72,7 +72,7 @@ sc_audio_player_sdl_callback(void *userdata, uint8_t *stream, int len_int) {
size_t len = len_int;
uint32_t count = TO_SAMPLES(len);
#ifndef SC_AUDIO_PLAYER_NDEBUG
#ifdef SC_AUDIO_PLAYER_DEBUG
LOGD("[Audio] SDL callback requests %" PRIu32 " samples", count);
#endif
@ -162,7 +162,7 @@ sc_audio_player_frame_sink_push(struct sc_frame_sink *sink,
// swr_convert() returns the number of samples which would have been
// written if the buffer was big enough.
uint32_t samples = MIN(ret, dst_nb_samples);
#ifndef SC_AUDIO_PLAYER_NDEBUG
#ifdef SC_AUDIO_PLAYER_DEBUG
LOGD("[Audio] %" PRIu32 " samples written to buffer", samples);
#endif
@ -244,7 +244,7 @@ sc_audio_player_frame_sink_push(struct sc_frame_sink *sink,
if (played) {
LOGD("[Audio] Buffering threshold exceeded, skipping %" PRIu32
" samples", skip_samples);
#ifndef SC_AUDIO_PLAYER_NDEBUG
#ifdef SC_AUDIO_PLAYER_DEBUG
} else {
LOGD("[Audio] Playback not started, skipping %" PRIu32
" samples", skip_samples);
@ -282,7 +282,7 @@ sc_audio_player_frame_sink_push(struct sc_frame_sink *sink,
// However, the buffering level must be smoothed
sc_average_push(&ap->avg_buffering, can_read);
#ifndef SC_AUDIO_PLAYER_NDEBUG
#ifdef SC_AUDIO_PLAYER_DEBUG
LOGD("[Audio] can_read=%" PRIu32 " avg_buffering=%f",
can_read, sc_average_get(&ap->avg_buffering));
#endif

View File

@ -4,7 +4,7 @@
#include "util/log.h"
#define SC_CLOCK_NDEBUG // comment to debug
//#define SC_CLOCK_DEBUG // uncomment to debug
#define SC_CLOCK_RANGE 32
@ -24,7 +24,7 @@ sc_clock_update(struct sc_clock *clock, sc_tick system, sc_tick stream) {
clock->offset = ((clock->range - 1) * clock->offset + offset)
/ clock->range;
#ifndef SC_CLOCK_NDEBUG
#ifdef SC_CLOCK_DEBUG
LOGD("Clock estimation: pts + %" PRItick, clock->offset);
#endif
}

View File

@ -78,7 +78,7 @@ run_buffering(void *data) {
goto stopped;
}
#ifndef SC_BUFFERING_NDEBUG
#ifdef SC_BUFFERING_DEBUG
LOGD("Buffering: %" PRItick ";%" PRItick ";%" PRItick,
pts, dframe.push_date, sc_tick_now());
#endif
@ -204,7 +204,7 @@ sc_delay_buffer_frame_sink_push(struct sc_frame_sink *sink,
return false;
}
#ifndef SC_BUFFERING_NDEBUG
#ifdef SC_BUFFERING_DEBUG
dframe.push_date = sc_tick_now();
#endif

View File

@ -12,14 +12,14 @@
#include "util/tick.h"
#include "util/vecdeque.h"
#define SC_BUFFERING_NDEBUG // comment to debug
//#define SC_BUFFERING_DEBUG // uncomment to debug
// forward declarations
typedef struct AVFrame AVFrame;
struct sc_delayed_frame {
AVFrame *frame;
#ifndef SC_BUFFERING_NDEBUG
#ifdef SC_BUFFERING_DEBUG
sc_tick push_date;
#endif
};