summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-17 18:01:26 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-20 21:39:37 +0200
commitac2e922067be306a89cd10419263cade54b2f60f (patch)
tree04486fac3fd732a3e8f52ac4eea337cecf70ab0b /src/DabMux.cpp
parent8a4f546b85d0887d1d5af0a428753c7d31304b72 (diff)
downloaddabmux-ac2e922067be306a89cd10419263cade54b2f60f.tar.gz
dabmux-ac2e922067be306a89cd10419263cade54b2f60f.tar.bz2
dabmux-ac2e922067be306a89cd10419263cade54b2f60f.zip
fix segfault with EDI
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 6003c48..1b889f3 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -677,7 +677,7 @@ int main(int argc, char *argv[])
AFPacketiser edi_afPacketiser(EDI_AFPACKET_PROTOCOLTYPE_TAGITEMS);
// The AF Packet will be protected with reed-solomon and split in fragments
- PFT edi_pft(128, 3);
+ PFT edi_pft(208, 3);
edi_tagDETI.atstf = 0; // TODO add ATST support
@@ -1946,10 +1946,10 @@ int main(int argc, char *argv[])
#endif // DUMP_BRIDGE
/**********************************************************************
- *********** Finalise EDI *****************************************
+ *********** Finalise and send EDI ********************************
**********************************************************************/
- // put all tags into one TagPacket
+ // put tags *ptr, DETI and all subchannels into one TagPacket
edi_tagpacket.tag_items.push_back(&edi_tagStarPtr);
edi_tagpacket.tag_items.push_back(&edi_tagDETI);
@@ -1958,9 +1958,12 @@ int main(int argc, char *argv[])
edi_tagpacket.tag_items.push_back(&(*tag));
}
+ // Assemble into one AF Packet
AFPacket edi_afpacket = edi_afPacketiser.Assemble(edi_tagpacket);
- vector< vector<uint8_t> > edi_fragments = edi_pft.ProtectAndFragment(edi_afpacket);
+ // Apply PFT layer to AF Packet (Reed Solomon FEC and Fragmentation)
+ vector< vector<uint8_t> > edi_fragments =
+ edi_pft.ProtectAndFragment(edi_afpacket);
#if EDI_DEBUG
std::ostream_iterator<uint8_t> debug_iterator(edi_debug_file);
@@ -2004,6 +2007,13 @@ int main(int argc, char *argv[])
etiLog.level(error) << "Caught multiplex initialisation error: " <<
except.what();
}
+ catch (std::invalid_argument& except) {
+ etiLog.level(error) << "Caught invalid argument : %s", except.what();
+ }
+ catch (std::runtime_error& except) {
+ etiLog.level(error) << "Caught runtime error : %s", except.what();
+ }
+
etiLog.log(debug, "exiting...\n");
fflush(stderr);
//fermeture des fichiers