diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-08-30 12:50:06 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-09-10 18:05:58 +0200 |
commit | 64694dc8561aa0a3b6399c59aad770a38a2f9ae2 (patch) | |
tree | ba3d29f9f4be436914de16da6c060980a6982a60 /src/pad_common.cpp | |
parent | cf8f54247dba07e990ec5fba0e75b5771e7e922e (diff) | |
download | ODR-PadEnc-64694dc8561aa0a3b6399c59aad770a38a2f9ae2.tar.gz ODR-PadEnc-64694dc8561aa0a3b6399c59aad770a38a2f9ae2.tar.bz2 ODR-PadEnc-64694dc8561aa0a3b6399c59aad770a38a2f9ae2.zip |
Improve verbose logging
Diffstat (limited to 'src/pad_common.cpp')
-rw-r--r-- | src/pad_common.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pad_common.cpp b/src/pad_common.cpp index 8ee2cd8..f8e769a 100644 --- a/src/pad_common.cpp +++ b/src/pad_common.cpp @@ -143,7 +143,9 @@ std::vector<uint8_t> PADPacketizer::GetNextPAD(bool output_xpad) { pad_t* pad = output_xpad ? GetPAD() : FlushPAD(); if (verbose >= 2) { - fprintf(stderr, "ODR-PadEnc writing PAD (%zu bytes):", pad->size()); + fprintf(stderr, "ODR-PadEnc writing %cPAD (%zu bytes):", + output_xpad ? 'X' : 'F', + 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]); @@ -227,6 +229,14 @@ bool PADPacketizer::AppendDG(DATA_GROUP* dg) { } else { AppendDGWithCI(dg); + /* + fprintf(stderr, "flush? %d %zu == %zu or %d: %zu + %zu > (%zu - %zu)\n", + used_cis == max_cis, + used_cis, max_cis, + SUBFIELD_LENS[0] + AddCINeededBytes() > (xpad_size_max - xpad_size), + SUBFIELD_LENS[0], AddCINeededBytes(), xpad_size_max, xpad_size); + */ + // if no further sub-fields could be added, PAD must be flushed if (used_cis == max_cis || SUBFIELD_LENS[0] + AddCINeededBytes() > (xpad_size_max - xpad_size)) return true; |