From 791f66b2b537c63da53566f5668e783e5f8283ac Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Wed, 14 Mar 2018 21:44:33 +0100 Subject: PAD: add debug output --- src/pad_common.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/pad_common.cpp') 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(); -- cgit v1.2.3