aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edioutput/TagPacket.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-05-11 21:03:36 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-05-11 21:03:36 +0200
commit19d907c885081a3218d81705fd45870b10f99d8d (patch)
tree2a56f22a1b4d5ba1d2d2619725899d5f49e260e9 /lib/edioutput/TagPacket.cpp
parent3a8a2aa8b682545a2a18bf24975555c7eb07152c (diff)
downloaddabmux-19d907c885081a3218d81705fd45870b10f99d8d.tar.gz
dabmux-19d907c885081a3218d81705fd45870b10f99d8d.tar.bz2
dabmux-19d907c885081a3218d81705fd45870b10f99d8d.zip
Common: update common code with EDI input changes
Diffstat (limited to 'lib/edioutput/TagPacket.cpp')
-rw-r--r--lib/edioutput/TagPacket.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/edioutput/TagPacket.cpp b/lib/edioutput/TagPacket.cpp
index b0bf9a1..ec52ad7 100644
--- a/lib/edioutput/TagPacket.cpp
+++ b/lib/edioutput/TagPacket.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014
+ Copyright (C) 2020
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
@@ -41,17 +41,19 @@ TagPacket::TagPacket(unsigned int alignment) : m_alignment(alignment)
std::vector<uint8_t> TagPacket::Assemble()
{
- std::list<TagItem*>::iterator tag;
+ if (raw_tagpacket.size() > 0 and tag_items.size() > 0) {
+ throw std::logic_error("TagPacket: both raw and items used!");
+ }
- std::vector<uint8_t> packet;
+ if (raw_tagpacket.size() > 0) {
+ return raw_tagpacket;
+ }
- //std::cerr << "Assemble TAGPacket" << std::endl;
+ std::vector<uint8_t> packet;
- for (tag = tag_items.begin(); tag != tag_items.end(); ++tag) {
- std::vector<uint8_t> tag_data = (*tag)->Assemble();
+ for (auto tag : tag_items) {
+ std::vector<uint8_t> tag_data = tag->Assemble();
packet.insert(packet.end(), tag_data.begin(), tag_data.end());
-
- //std::cerr << " Add TAGItem of length " << tag_data.size() << std::endl;
}
if (m_alignment == 0) { /* no padding */ }