summaryrefslogtreecommitdiffstats
path: root/src/dabOutput
diff options
context:
space:
mode:
Diffstat (limited to 'src/dabOutput')
-rw-r--r--src/dabOutput/dabOutput.h2
-rw-r--r--src/dabOutput/edi/AFPacket.cpp3
-rw-r--r--src/dabOutput/edi/PFT.cpp2
-rw-r--r--src/dabOutput/edi/PFT.h8
4 files changed, 8 insertions, 7 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h
index f6980fe..c8ce9f2 100644
--- a/src/dabOutput/dabOutput.h
+++ b/src/dabOutput/dabOutput.h
@@ -55,6 +55,8 @@
// Configuration for EDI output
struct edi_configuration_t {
+ unsigned chunk_len; // RSk, data length of each chunk
+ unsigned fec; // number of fragments that can be recovered
bool enabled;
unsigned int source_port;
bool dump;
diff --git a/src/dabOutput/edi/AFPacket.cpp b/src/dabOutput/edi/AFPacket.cpp
index 3b69f1c..a1d39b9 100644
--- a/src/dabOutput/edi/AFPacket.cpp
+++ b/src/dabOutput/edi/AFPacket.cpp
@@ -39,7 +39,7 @@
#define AFHEADER_PT_TAG 'T'
// AF Packet Major (3 bits) and Minor (4 bits) version
-#define AFHEADER_VERSION 0x8 // MAJ=1, MIN=0
+#define AFHEADER_VERSION 0x10 // MAJ=1, MIN=0
AFPacket AFPacketiser::Assemble(TagPacket tag_packet)
{
@@ -65,6 +65,7 @@ AFPacket AFPacketiser::Assemble(TagPacket tag_packet)
// fill rest of header
packet.push_back(seq >> 8);
packet.push_back(seq & 0xFF);
+ seq++;
packet.push_back((have_crc ? 0x80 : 0) | AFHEADER_VERSION); // ar_cf: CRC=1
packet.push_back(AFHEADER_PT_TAG);
diff --git a/src/dabOutput/edi/PFT.cpp b/src/dabOutput/edi/PFT.cpp
index e1c8249..7f463cc 100644
--- a/src/dabOutput/edi/PFT.cpp
+++ b/src/dabOutput/edi/PFT.cpp
@@ -52,7 +52,7 @@ RSBlock PFT::Protect(AFPacket af_packet)
// number of chunks is ceil(afpacketsize / m_k)
// TS 102 821 7.2.2: c = ceil(l / k_max)
- m_num_chunks = CEIL_DIV(af_packet.size(), 207);
+ m_num_chunks = CEIL_DIV(af_packet.size(), m_k);
if (m_verbose) {
fprintf(stderr, "Protect %zu chunks of size %zu\n",
diff --git a/src/dabOutput/edi/PFT.h b/src/dabOutput/edi/PFT.h
index 9c6f7bd..e17d282 100644
--- a/src/dabOutput/edi/PFT.h
+++ b/src/dabOutput/edi/PFT.h
@@ -57,11 +57,9 @@ class PFT
m_verbose(false)
{ }
- PFT(unsigned int RSDataWordLength,
- unsigned int NumRecoverableFragments,
- const edi_configuration_t &conf) :
- m_k(RSDataWordLength),
- m_m(NumRecoverableFragments),
+ PFT(const edi_configuration_t &conf) :
+ m_k(conf.chunk_len),
+ m_m(conf.fec),
m_dest_port(conf.dest_port),
m_pseq(0),
m_verbose(conf.verbose)