From 1904f3b33f0595846f641833de0d9a2f9fe6d4d0 Mon Sep 17 00:00:00 2001 From: Rob Sykes Date: Sat, 5 Mar 2016 21:32:03 +0000 Subject: [PATCH] show which soxr_engine() was used --- examples/3-options-input-fn.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/3-options-input-fn.c b/examples/3-options-input-fn.c index a29c90f..afd43b9 100644 --- a/examples/3-options-input-fn.c +++ b/examples/3-options-input-fn.c @@ -42,7 +42,7 @@ static size_t input_fn(input_context_t * p, soxr_cbuf_t * buf, size_t len) int main(int n, char const * arg[]) { - char const * const arg0 = n? --n, *arg++ : ""; + char const * const arg0 = n? --n, *arg++ : "", * engine = ""; double const irate = n? --n, atof(*arg++) : 96000.; double const orate = n? --n, atof(*arg++) : 44100.; unsigned const chans = n? --n, (unsigned)atoi(*arg++) : 1; @@ -94,6 +94,7 @@ int main(int n, char const * arg[]) } if (!error) { /* If all is well, run the resampler: */ + engine = soxr_engine(soxr); USE_STD_STDIO; /* Resample in blocks: */ do odone = soxr_output(soxr, obuf, olen); @@ -106,8 +107,8 @@ int main(int n, char const * arg[]) soxr_delete(soxr); free(obuf), free(ibuf); /* Diagnostics: */ - fprintf(stderr, "%-26s %s; %lu clips; I/O: %s\n", + fprintf(stderr, "%-26s %s; %lu clips; I/O: %s (%s)\n", arg0, soxr_strerror(error), (long unsigned)clips, - ferror(stdin) || ferror(stdout)? strerror(errno) : "no error"); + ferror(stdin) || ferror(stdout)? strerror(errno) : "no error", engine); return !!error; }