Skip to content

Display and control your Android device

Reverse NDEBUG conditions

Romain Vimont63ced7984265
diff --git a/app/src/audio_player.c b/app/src/audio_player.c
index dac85bf9..274b6948 100644
--- a/app/src/audio_player.c
+++ b/app/src/audio_player.c
@@ -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
diff --git a/app/src/clock.c b/app/src/clock.c
index 92989bfe..e9c9ac35 100644
--- a/app/src/clock.c
+++ b/app/src/clock.c
@@ -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
}
diff --git a/app/src/delay_buffer.c b/app/src/delay_buffer.c
index b27d4939..a9dc9a35 100644
--- a/app/src/delay_buffer.c
+++ b/app/src/delay_buffer.c
@@ -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
diff --git a/app/src/delay_buffer.h b/app/src/delay_buffer.h
index f0fe97d3..18c1ce94 100644
--- a/app/src/delay_buffer.h
+++ b/app/src/delay_buffer.h
@@ -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
};