summaryrefslogtreecommitdiffstats
path: root/src/dabOutput
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-28 16:14:08 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-28 16:14:08 +0100
commit000796dc3d909f179fb6586fae7e9ce986440576 (patch)
treea6b08f5866af7d5943052d18b7162ba3ed897d37 /src/dabOutput
parentaf782e67db704d1d58c265fb4e1ff12aa1526596 (diff)
downloaddabmux-000796dc3d909f179fb6586fae7e9ce986440576.tar.gz
dabmux-000796dc3d909f179fb6586fae7e9ce986440576.tar.bz2
dabmux-000796dc3d909f179fb6586fae7e9ce986440576.zip
Avoid uninitialised fields, modernise DabService::nbComponent
Diffstat (limited to 'src/dabOutput')
-rw-r--r--src/dabOutput/dabOutput.h18
-rw-r--r--src/dabOutput/edi/AFPacket.h2
-rw-r--r--src/dabOutput/edi/TagItems.h38
3 files changed, 23 insertions, 35 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h
index 11b78e6..2e5f489 100644
--- a/src/dabOutput/dabOutput.h
+++ b/src/dabOutput/dabOutput.h
@@ -59,17 +59,15 @@ struct edi_destination_t {
};
struct edi_configuration_t {
- edi_configuration_t() :
- verbose(false) {}
- unsigned chunk_len; // RSk, data length of each chunk
- unsigned fec; // number of fragments that can be recovered
- bool dump; // dump a file with the EDI packets
- bool verbose;
- bool enable_pft; // Enable protection and fragmentation
- unsigned int tagpacket_alignment;
+ unsigned chunk_len = 207; // RSk, data length of each chunk
+ unsigned fec = 0; // number of fragments that can be recovered
+ bool dump = false; // dump a file with the EDI packets
+ bool verbose = false;
+ bool enable_pft = false; // Enable protection and fragmentation
+ unsigned int tagpacket_alignment = 0;
std::vector<edi_destination_t> destinations;
- unsigned int dest_port; // common destination port, because it's encoded in the transport layer
- unsigned int latency_frames; // if nonzero, enable interleaver with a latency of latency_frames * 24ms
+ unsigned int dest_port = 0; // common destination port, because it's encoded in the transport layer
+ unsigned int latency_frames = 0; // if nonzero, enable interleaver with a latency of latency_frames * 24ms
bool enabled() const { return destinations.size() > 0; }
bool interleaver_enabled() const { return latency_frames > 0; }
diff --git a/src/dabOutput/edi/AFPacket.h b/src/dabOutput/edi/AFPacket.h
index 0ffd13f..b4ccef1 100644
--- a/src/dabOutput/edi/AFPacket.h
+++ b/src/dabOutput/edi/AFPacket.h
@@ -52,7 +52,7 @@ class AFPacketiser
private:
static const bool have_crc = true;
- uint16_t seq; //counter that overflows at 0xFFFF
+ uint16_t seq = 0; //counter that overflows at 0xFFFF
bool m_verbose;
};
diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h
index fb876cc..856d25b 100644
--- a/src/dabOutput/edi/TagItems.h
+++ b/src/dabOutput/edi/TagItems.h
@@ -54,30 +54,20 @@ class TagStarPTR : public TagItem
class TagDETI : public TagItem
{
public:
- TagDETI()
- {
- // set optional fields to "not present"
- atstf = 0;
- rfudf = 0;
- ficf = 0;
-
- rfa = 0; //shall be zero
- rfu = 0; //mnsc is valid
- }
std::vector<uint8_t> Assemble();
/***** DATA in intermediary format ****/
// For the ETI Header: must be defined !
- uint8_t stat;
- uint8_t mid;
- uint8_t fp;
- uint8_t rfa;
- uint8_t rfu;
- uint16_t mnsc;
- uint16_t dflc; // modulo 5000 frame counter
+ uint8_t stat = 0;
+ uint8_t mid = 0;
+ uint8_t fp = 0;
+ uint8_t rfa = 0;
+ uint8_t rfu = 0; // MNSC is valid
+ uint16_t mnsc = 0;
+ uint16_t dflc = 0; // modulo 5000 frame counter
// ATST (optional)
- bool atstf; // presence of atst data
+ bool atstf = false; // presence of atst data
/* UTCO: Offset (in seconds) between UTC and the Seconds value. The
* value is expressed as an unsigned 8-bit quantity. As of February
@@ -93,14 +83,14 @@ class TagDETI : public TagItem
* where the TAI-UTC offset is given by the USNO bulletin using
* the ClockTAI module.
*/
- uint8_t utco;
+ uint8_t utco = 0;
void set_tai_utc_offset(int tai_utc_offset) { utco = tai_utc_offset - 32; }
/* The number of SI seconds since 2000-01-01 T 00:00:00 UTC as an
* unsigned 32-bit quantity
*/
- uint32_t seconds;
+ uint32_t seconds = 0;
void set_seconds(std::chrono::system_clock::time_point t);
@@ -110,16 +100,16 @@ class TagDETI : public TagItem
* significant 8 bits of the TIST field of the incoming STI-D(LI)
* frame, if required, may be carried in the RFAD field.
*/
- uint32_t tsta;
+ uint32_t tsta = 0xFFFFFF;
// the FIC (optional)
- bool ficf;
+ bool ficf = false;
const unsigned char* fic_data;
size_t fic_length;
// rfu
- bool rfudf;
- uint32_t rfud;
+ bool rfudf = false;
+ uint32_t rfud = 0;
};