aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2017-08-23 22:00:04 +0200
committerStefan Pöschel <github@basicmaster.de>2017-08-23 22:00:04 +0200
commit0de7167c78eae8066996aa3cb86dbfefd5cfcb63 (patch)
tree85e7135735d02955aff9f5d26106677e7745119d
parent8a8e5f1b05330316ba74b14fc71e13223bef35f3 (diff)
downloadODR-PadEnc-0de7167c78eae8066996aa3cb86dbfefd5cfcb63.tar.gz
ODR-PadEnc-0de7167c78eae8066996aa3cb86dbfefd5cfcb63.tar.bz2
ODR-PadEnc-0de7167c78eae8066996aa3cb86dbfefd5cfcb63.zip
PAD: add option to output also sole F-PAD
-rw-r--r--src/pad_common.cpp7
-rw-r--r--src/pad_common.h4
2 files changed, 5 insertions, 6 deletions
diff --git a/src/pad_common.cpp b/src/pad_common.cpp
index 5ba4c7f..f60b2eb 100644
--- a/src/pad_common.cpp
+++ b/src/pad_common.cpp
@@ -131,7 +131,8 @@ pad_t* PADPacketizer::GetPAD() {
return FlushPAD();
}
-void PADPacketizer::WriteAllPADs(int output_fd, int limit) {
+
+void PADPacketizer::WriteAllPADs(int output_fd, int limit, bool output_sole_fpad) {
size_t error_count = 0;
size_t error_bytes = 0;
@@ -139,8 +140,8 @@ void PADPacketizer::WriteAllPADs(int output_fd, int limit) {
for (int i = 0; i != limit; i++) {
pad_t* pad = GetPAD();
- // if only F-PAD present, abort
- if (pad->back() == FPAD_LEN) {
+ // if only F-PAD present, abort (if desired)
+ if (pad->back() == FPAD_LEN && !output_sole_fpad) {
delete pad;
break;
}
diff --git a/src/pad_common.h b/src/pad_common.h
index c9dd434..a173d9d 100644
--- a/src/pad_common.h
+++ b/src/pad_common.h
@@ -121,9 +121,7 @@ public:
bool QueueFilled();
pad_t* GetPAD();
-
- // will be removed, when pull (instead of push) approach is implemented!
- void WriteAllPADs(int output_fd, int limit = -1);
+ void WriteAllPADs(int output_fd, int limit = -1, bool output_sole_fpad = false);
static DATA_GROUP* CreateDataGroupLengthIndicator(size_t len);
static bool CheckPADLen(size_t len);