From ea592d8fb591ba469db360fb32d76d7fafb117d6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 25 Apr 2014 17:53:30 +0200 Subject: Always print underruns and overruns --- src/dabplus-enc.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/dabplus-enc.cpp') diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index 82780d5..f45bc0a 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -60,8 +60,8 @@ void usage(const char* name) { "make sure that the encoding rate is correct by inserting or deleting\n" "audio samples.\n" "\n" - "When this option is enabled, you will see U and O printed in\n" - "the console. These correspond to audio underruns and overruns caused\n" + "When this option is enabled, you will see U and O printed in the\n" + "console. These correspond to audio underruns and overruns caused\n" "by sound card clock drift. When sparse, they should not create audible\n" "artifacts.\n" "\n" @@ -692,13 +692,24 @@ int main(int argc, char *argv[]) break; } - if (show_level && out_args.numOutBytes + row*10 == outbuf_size) { - fprintf(stderr, "\rIn: [%6s|%-6s] %1s %1s %1s", - level(0, &peak_left), - level(1, &peak_right), - status & STATUS_PAD_INSERTED ? "P" : " ", - status & STATUS_UNDERRUN ? "U" : " ", - status & STATUS_OVERRUN ? "O" : " "); + if (out_args.numOutBytes + row*10 == outbuf_size) { + if (show_level) { + fprintf(stderr, "\rIn: [%6s|%-6s] %1s %1s %1s", + level(0, &peak_left), + level(1, &peak_right), + status & STATUS_PAD_INSERTED ? "P" : " ", + status & STATUS_UNDERRUN ? "U" : " ", + status & STATUS_OVERRUN ? "O" : " "); + } + else { + if (status & STATUS_OVERRUN) { + fprintf(stderr, "O"); + } + + if (status & STATUS_UNDERRUN) { + fprintf(stderr, "U"); + } + } } status = 0; -- cgit v1.2.3