Add buffering debugging tools

Output buffering and clock logs by disabling a compilation flag.
This commit is contained in:
Romain Vimont
2021-07-13 22:32:05 +02:00
parent 2f03141e9f
commit 4c4d02295c
4 changed files with 23 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
#include "clock.h"
#include "util/log.h"
#define SC_CLOCK_NDEBUG // comment to debug
void
sc_clock_init(struct sc_clock *clock) {
clock->count = 0;
@@ -80,6 +84,11 @@ sc_clock_update(struct sc_clock *clock, sc_tick system, sc_tick stream) {
if (clock->count > 1) {
// Update estimation
sc_clock_estimate(clock, &clock->slope, &clock->offset);
#ifndef SC_CLOCK_NDEBUG
LOGD("Clock estimation: %g * pts + %" PRItick,
clock->slope, clock->offset);
#endif
}
}