summaryrefslogtreecommitdiffstats
path: root/src/dabplus-enc.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-25 17:53:30 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-25 17:53:46 +0200
commitea592d8fb591ba469db360fb32d76d7fafb117d6 (patch)
treedcc0aa33dbd32f9731ec6107893020b2de129a5b /src/dabplus-enc.cpp
parenta8bd9b19bba683031f6c7a68e9e6ca653be18d6c (diff)
downloadODR-AudioEnc-ea592d8fb591ba469db360fb32d76d7fafb117d6.tar.gz
ODR-AudioEnc-ea592d8fb591ba469db360fb32d76d7fafb117d6.tar.bz2
ODR-AudioEnc-ea592d8fb591ba469db360fb32d76d7fafb117d6.zip
Always print underruns and overruns
Diffstat (limited to 'src/dabplus-enc.cpp')
-rw-r--r--src/dabplus-enc.cpp29
1 files changed, 20 insertions, 9 deletions
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<number> 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;