summaryrefslogtreecommitdiffstats
path: root/src/fig/FIG1.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-02-13 09:29:47 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-02-13 09:29:47 +0100
commit8594e81beadc395b3fc2568dc29b48712acb2561 (patch)
treeb22d00fc01aa81a095b0664b3b947781a1064a49 /src/fig/FIG1.cpp
parentc4833640f8dddbe556cc6d40211223a05d5270b8 (diff)
parent7eb97a486a8a39ef3986b9c2c7c452e9ccf2693a (diff)
downloaddabmux-8594e81beadc395b3fc2568dc29b48712acb2561.tar.gz
dabmux-8594e81beadc395b3fc2568dc29b48712acb2561.tar.bz2
dabmux-8594e81beadc395b3fc2568dc29b48712acb2561.zip
Merge KuntzeM's pull request fixing #35 into next
ETI with DAB (MUSICAM) and EEP_A protection level was not possible.
Diffstat (limited to 'src/fig/FIG1.cpp')
-rw-r--r--src/fig/FIG1.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/fig/FIG1.cpp b/src/fig/FIG1.cpp
index 7171a87..d0b6a17 100644
--- a/src/fig/FIG1.cpp
+++ b/src/fig/FIG1.cpp
@@ -94,10 +94,11 @@ FillStatus FIG1_1::fill(uint8_t *buf, size_t max_size)
break;
}
- if ((*service)->getType(ensemble) == subchannel_type_t::Audio and
- (*service)->label.has_fig1_label()) {
+ const auto type = (*service)->getType(ensemble);
- auto fig1_1 = (FIGtype1_1*)buf;
+ if ( (type == subchannel_type_t::DABPlusAudio or type == subchannel_type_t::DABAudio) and
+ (*service)->label.has_fig1_label()) {
+ auto fig1_1 = (FIGtype1_1 *)buf;
fig1_1->FIGtypeNumber = 1;
fig1_1->Length = 21;
@@ -154,8 +155,11 @@ FillStatus FIG1_4::fill(uint8_t *buf, size_t max_size)
/* We check in the config parser if the primary component has
* a label, which is forbidden since V2.1.1 */
- if ((*component)->label.has_fig1_label() ) {
- if ((*service)->getType(ensemble) == subchannel_type_t::Audio) {
+ const auto type = (*service)->getType(ensemble);
+
+ if (not (*component)->label.long_label().empty() ) {
+ if (type == subchannel_type_t::DABAudio or type == subchannel_type_t::DABPlusAudio) {
+
if (remaining < 5 + 16 + 2) {
break;
}
@@ -241,8 +245,10 @@ FillStatus FIG1_5::fill(uint8_t *buf, size_t max_size)
break;
}
- if ((*service)->getType(ensemble) != subchannel_type_t::Audio and
- (*service)->label.has_fig1_label()) {
+ const auto type = (*service)->getType(ensemble);
+ const bool is_audio = (type == subchannel_type_t::DABAudio or type == subchannel_type_t::DABPlusAudio);
+
+ if (not is_audio) {
auto fig1_5 = (FIGtype1_5 *)buf;
fig1_5->FIGtypeNumber = 1;
fig1_5->Length = 23;