diff --git a/spa/include/spa/node/io.h b/spa/include/spa/node/io.h index cf6b9de4f..d4694adf8 100644 --- a/spa/include/spa/node/io.h +++ b/spa/include/spa/node/io.h @@ -83,7 +83,7 @@ struct spa_io_range { struct spa_io_clock { uint32_t id; /**< unique clock id, set by application */ uint32_t flags; /**< clock flags */ - uint64_t nsec; /**< time in nanoseconds */ + uint64_t nsec; /**< time in nanoseconds against monotonic clock */ uint64_t count; /**< a media specific counter. Can be used to detect * gaps in the media. It usually represents the amount * of processed media units (packets, frames, diff --git a/spa/plugins/audioconvert/resample-native.h b/spa/plugins/audioconvert/resample-native.h index 869b4eec1..5d4f7654c 100644 --- a/spa/plugins/audioconvert/resample-native.h +++ b/spa/plugins/audioconvert/resample-native.h @@ -139,7 +139,7 @@ static void impl_native_update_rate(struct resample *r, double rate) static uint32_t impl_native_in_len(struct resample *r, uint32_t out_len) { - struct native_data *data = r->data; \ + struct native_data *data = r->data; uint32_t in_len; in_len = (data->phase + out_len * data->frac) / data->out_rate; @@ -232,6 +232,8 @@ static void impl_native_process(struct resample *r, for (c = 0; c < r->channels; c++) memmove(history[c], &history[c][in], remain * sizeof(float)); } + spa_log_trace_fp(r->log, "native %p: in:%d remain:%d", r, in, remain); + } data->hist = remain; return; diff --git a/spa/plugins/audioconvert/test-resample.c b/spa/plugins/audioconvert/test-resample.c index b5464beb8..52c14d973 100644 --- a/spa/plugins/audioconvert/test-resample.c +++ b/spa/plugins/audioconvert/test-resample.c @@ -29,8 +29,11 @@ #include #include +#include #include +SPA_LOG_IMPL(logger); + #include "resample.h" #include "resample-native.h" @@ -65,6 +68,7 @@ static void test_native(void) struct resample r; spa_zero(r); + r.log = &logger.log; r.channels = 1; r.i_rate = 44100; r.o_rate = 44100; @@ -73,6 +77,7 @@ static void test_native(void) feed_1(&r); spa_zero(r); + r.log = &logger.log; r.channels = 1; r.i_rate = 44100; r.o_rate = 48000; @@ -114,6 +119,7 @@ static void test_in_len(void) struct resample r; spa_zero(r); + r.log = &logger.log; r.channels = 1; r.i_rate = 32000; r.o_rate = 48000; @@ -122,6 +128,7 @@ static void test_in_len(void) pull_blocks(&r, 1024); spa_zero(r); + r.log = &logger.log; r.channels = 1; r.i_rate = 44100; r.o_rate = 48000; @@ -130,6 +137,7 @@ static void test_in_len(void) pull_blocks(&r, 1024); spa_zero(r); + r.log = &logger.log; r.channels = 1; r.i_rate = 48000; r.o_rate = 44100; @@ -140,6 +148,8 @@ static void test_in_len(void) int main(int argc, char *argv[]) { + logger.log.level = SPA_LOG_LEVEL_TRACE; + test_native(); test_in_len();