aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2018-03-14 21:44:33 +0100
committerStefan Pöschel <github@basicmaster.de>2018-03-14 21:44:33 +0100
commit791f66b2b537c63da53566f5668e783e5f8283ac (patch)
treec9dbabf0542d2cb3f3f7570bbcddc03749adac43
parent8a738dbdafdca5b55b23cd31791a9c0d48d7c9ec (diff)
downloadODR-PadEnc-791f66b2b537c63da53566f5668e783e5f8283ac.tar.gz
ODR-PadEnc-791f66b2b537c63da53566f5668e783e5f8283ac.tar.bz2
ODR-PadEnc-791f66b2b537c63da53566f5668e783e5f8283ac.zip
PAD: add debug output
-rw-r--r--src/odr-padenc.cpp2
-rw-r--r--src/pad_common.cpp11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/odr-padenc.cpp b/src/odr-padenc.cpp
index 8ae06f2..d684c6c 100644
--- a/src/odr-padenc.cpp
+++ b/src/odr-padenc.cpp
@@ -81,7 +81,7 @@ static void usage(const char* name) {
" -R, --raw-slides Do not process slides. Integrity checks and resizing\n"
" slides is skipped. Use this if you know what you are doing !\n"
" It is useful only when -d is used\n"
- " -v, --verbose Print more information to the console\n"
+ " -v, --verbose Print more information to the console (may be used more than once)\n"
"\n"
"Parameters for uniform PAD encoder only:\n"
" -f, --frame-dur=DUR Enable the uniform PAD encoder and set the duration of one frame/AU in milliseconds.\n"
diff --git a/src/pad_common.cpp b/src/pad_common.cpp
index f5da635..57d2837 100644
--- a/src/pad_common.cpp
+++ b/src/pad_common.cpp
@@ -3,7 +3,7 @@
Copyright (C) 2014, 2015 Matthias P. Braendli (http://opendigitalradio.org)
- Copyright (C) 2015, 2016, 2017 Stefan Pöschel (http://opendigitalradio.org)
+ Copyright (C) 2015, 2016, 2017, 2018 Stefan Pöschel (http://opendigitalradio.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -154,6 +154,15 @@ void PADPacketizer::WriteAllPADs(int output_fd, int limit, bool output_sole_fpad
break;
}
+ if (verbose >= 2) {
+ fprintf(stderr, "ODR-PadEnc writing PAD (%zu bytes):", pad->size());
+ for(size_t j = 0; j < pad->size(); j++) {
+ const char sep = (j == (pad->size() - 1) || j == (pad->size() - 1 - FPAD_LEN)) ? '|' : ' ';
+ fprintf(stderr, "%c%02X", sep , (*pad)[j]);
+ }
+ fprintf(stderr, "\n");
+ }
+
if (write(output_fd, &(*pad)[0], pad->size()) != (signed) pad->size()) {
error_count++;
error_bytes += pad->size();