summaryrefslogtreecommitdiffstats
path: root/src/dabplus-enc.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-12-22 17:45:26 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-12-22 17:45:26 +0100
commit7caf4423145b5b2629502f8d227dc348bd232887 (patch)
treed65211c57149b4dfea0366b69dfc69ee6b7df41e /src/dabplus-enc.cpp
parentab2442bd9f1139b2abe8e26a593785703b78d58c (diff)
downloadODR-AudioEnc-7caf4423145b5b2629502f8d227dc348bd232887.tar.gz
ODR-AudioEnc-7caf4423145b5b2629502f8d227dc348bd232887.tar.bz2
ODR-AudioEnc-7caf4423145b5b2629502f8d227dc348bd232887.zip
Fix level indication in mono
Diffstat (limited to 'src/dabplus-enc.cpp')
-rw-r--r--src/dabplus-enc.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp
index b474914..0862690 100644
--- a/src/dabplus-enc.cpp
+++ b/src/dabplus-enc.cpp
@@ -832,24 +832,35 @@ int main(int argc, char *argv[])
}
}
- if (out_args.numOutBytes + row*10 == outbuf_size) {
- if (show_level) {
+ if (show_level) {
+ if (channels == 1) {
+ fprintf(stderr, "\rIn: [%-6s] %1s %1s %1s",
+ level(1, MAX(peak_right, peak_left)),
+ status & STATUS_PAD_INSERTED ? "P" : " ",
+ status & STATUS_UNDERRUN ? "U" : " ",
+ status & STATUS_OVERRUN ? "O" : " ");
+ }
+ else if (channels == 2) {
fprintf(stderr, "\rIn: [%6s|%-6s] %1s %1s %1s",
- level(0, &peak_left),
- level(1, &peak_right),
+ 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");
- }
+ peak_right = 0;
+ peak_left = 0;
+ }
+ else {
+ if (status & STATUS_OVERRUN) {
+ fprintf(stderr, "O");
}
+
+ if (status & STATUS_UNDERRUN) {
+ fprintf(stderr, "U");
+ }
+
}
status = 0;