From 966a696e55f2112bb44d95b2b22a7e20423d1bad Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 3 May 2023 15:24:33 +0200 Subject: Ensure EDI inserts ESTn tags in the config file order Even though the spec says EDI decoders shall not assume any particular ordering, we've seen some that misbehave --- src/DabMultiplexer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index a658262..fb5ec45 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -408,7 +408,7 @@ void DabMultiplexer::mux_frame(std::vector >& outputs // For EDI, save ETI(LI) Management data into a TAG Item DETI edi::TagDETI edi_tagDETI; edi::TagStarPTR edi_tagStarPtr("DETI"); - map edi_subchannelToTag; + vector edi_est_tags; // The above Tag Items will be assembled into a TAG Packet edi::TagPacket edi_tagpacket(edi_conf.tagpacket_alignment); @@ -541,7 +541,7 @@ void DabMultiplexer::mux_frame(std::vector >& outputs tag_ESTn.mst_data = nullptr; assert(subchannel->getSizeByte() % 8 == 0); - edi_subchannelToTag[subchannel.get()] = tag_ESTn; + edi_est_tags.push_back(std::move(tag_ESTn)); index += 4; } @@ -619,8 +619,8 @@ void DabMultiplexer::mux_frame(std::vector >& outputs ****** Input Data Reading ******************************************* **********************************************************************/ - for (auto subchannel : ensemble->subchannels) { - edi::TagESTn& tag = edi_subchannelToTag[subchannel.get()]; + for (size_t i = 0; i < ensemble->subchannels.size(); i++) { + auto& subchannel = ensemble->subchannels[i]; int sizeSubchannel = subchannel->getSizeByte(); // no need to check enableTist because we always increment the timestamp @@ -634,7 +634,7 @@ void DabMultiplexer::mux_frame(std::vector >& outputs } // save pointer to Audio or Data Stream into correct TagESTn for EDI - tag.mst_data = &etiFrame[index]; + edi_est_tags[i].mst_data = &etiFrame[index]; index += sizeSubchannel; } @@ -746,8 +746,8 @@ void DabMultiplexer::mux_frame(std::vector >& outputs edi_tagpacket.tag_items.push_back(&edi_tagStarPtr); edi_tagpacket.tag_items.push_back(&edi_tagDETI); - for (auto& tag : edi_subchannelToTag) { - edi_tagpacket.tag_items.push_back(&tag.second); + for (auto& tag : edi_est_tags) { + edi_tagpacket.tag_items.push_back(&tag); } edi_sender->write(edi_tagpacket); -- cgit v1.2.3