diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-05-21 17:23:36 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-05-21 17:23:36 +0200 |
commit | d60b36afc30460f070f25dd8ee8d52b556ea8790 (patch) | |
tree | 7b1c9674579bc5de0535ff581e1f6ed99a60a669 /src/DabMux.cpp | |
parent | 91aa7a5ee75298f9ded7db18f4ba0156bbfc3bb3 (diff) | |
download | dabmux-d60b36afc30460f070f25dd8ee8d52b556ea8790.tar.gz dabmux-d60b36afc30460f070f25dd8ee8d52b556ea8790.tar.bz2 dabmux-d60b36afc30460f070f25dd8ee8d52b556ea8790.zip |
Add PFT Fragment header
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 41d7f72..704de4c 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -682,7 +682,7 @@ int main(int argc, char *argv[]) // The AF Packet will be protected with reed-solomon and split in fragments #if EDI_PFT - PFT edi_pft(208, 3); + PFT edi_pft(207, 3); #endif edi_tagDETI.atstf = 0; // TODO add ATST support @@ -1970,8 +1970,8 @@ int main(int argc, char *argv[]) # if EDI_PFT // Apply PFT layer to AF Packet (Reed Solomon FEC and Fragmentation) - vector< vector<uint8_t> > edi_fragments = - edi_pft.ProtectAndFragment(edi_afpacket); + vector< PFTFragment > edi_fragments = + edi_pft.Assemble(edi_afpacket); // Send over ethernet vector< vector<uint8_t> >::iterator edi_frag; @@ -1982,13 +1982,15 @@ int main(int argc, char *argv[]) UdpPacket udppacket; InetAddress& addr = udppacket.getAddress(); - addr.setAddress("192.168.2.2"); + addr.setAddress("127.0.0.1"); addr.setPort(12000); udppacket.addData(&(edi_frag->front()), edi_frag->size()); edi_output.send(udppacket); } + + fprintf(stderr, "EDI number of PFT fragments %zu\n", edi_fragments.size()); # else // Send over ethernet @@ -2005,7 +2007,6 @@ int main(int argc, char *argv[]) //std::ostream_iterator<uint8_t> debug_iterator(edi_debug_file); //std::copy(edi_afpacket.begin(), edi_afpacket.end(), debug_iterator); - fprintf(stderr, "EDI number of fragments %zu\n", edi_fragments.size()); #endif #if _DEBUG @@ -2057,7 +2058,9 @@ int main(int argc, char *argv[]) for (subchannel = ensemble->subchannels.begin(); subchannel != ensemble->subchannels.end(); ++subchannel) { - (*subchannel)->input->close(); + if ((*subchannel)->input != NULL) { + (*subchannel)->input->close(); + } delete (*subchannel)->input; } for (output = outputs.begin() ; output != outputs.end(); ++output) { |