diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-02 15:50:58 +0200 | 
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-02 15:50:58 +0200 | 
| commit | 0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7 (patch) | |
| tree | ad859d6a5893d15a215d648e5941ea03f63be3ca | |
| parent | 5736f17d34ffc86aeedb95cf652968eadf256051 (diff) | |
| download | dabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.tar.gz dabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.tar.bz2 dabmux-0fa7f1d17cd8554db8e3d3bbe7603495b2ac07c7.zip | |
Set IdLQ properly in FIG0/6
| -rw-r--r-- | doc/servicelinking.mux | 5 | ||||
| -rw-r--r-- | src/fig/FIG0_6.cpp | 24 | 
2 files changed, 18 insertions, 11 deletions
| diff --git a/doc/servicelinking.mux b/doc/servicelinking.mux index 7fd90ba..b9a64d9 100644 --- a/doc/servicelinking.mux +++ b/doc/servicelinking.mux @@ -7,7 +7,7 @@  ;  general {      dabmode 1 -    nbframes 0 +    nbframes 10000      syslog false      tist false @@ -132,7 +132,6 @@ components {  }  outputs { -    tcp "tcp://0.0.0.0:9200" -    throttle "simul://" +    file "file://./test.eti?type=raw"  } diff --git a/src/fig/FIG0_6.cpp b/src/fig/FIG0_6.cpp index 8c0e53d..fa8cbfa 100644 --- a/src/fig/FIG0_6.cpp +++ b/src/fig/FIG0_6.cpp @@ -104,7 +104,22 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size)                  throw MuxInitException();              } -            header->IdLQ = 0; // TODO not only DAB +            // update() guarantees us that all entries in a linkage set +            // have the same type +            for (const auto& l : linkageSetFIG0_6->id_list) { +                if (l.type != linkageSetFIG0_6->id_list.front().type) { +                    etiLog.log(error, "INTERNAL ERROR: invalid linkage subset 0x%04x", +                        linkageSetFIG0_6->lsn); +                    throw std::runtime_error("INTERNAL ERROR"); +                } +            } + +            switch (linkageSetFIG0_6->id_list.front().type) { +                case ServiceLinkType::DAB: header->IdLQ  = FIG0_6_IDLQ_DAB; break; +                case ServiceLinkType::FM: header->IdLQ   = FIG0_6_IDLQ_RDS; break; +                case ServiceLinkType::DRM: header->IdLQ  = FIG0_6_IDLQ_DRM_AMSS; break; +                case ServiceLinkType::AMSS: header->IdLQ = FIG0_6_IDLQ_DRM_AMSS; break; +            }              header->rfa = 0;              header->num_ids = num_ids; @@ -126,13 +141,6 @@ FillStatus FIG0_6::fill(uint8_t *buf, size_t max_size)                          keyserviceuid.c_str(), linkageSetFIG0_6->lsn);                  throw MuxInitException();              } -            for (const auto& l : linkageSetFIG0_6->id_list) { -                if (l.type != ServiceLinkType::DAB) { -                    etiLog.log(error, "TODO only DAB links supported. (linkage set 0x%04x)", -                            linkageSetFIG0_6->lsn); -                    throw MuxInitException(); -                } -            }              if (not PD and not ILS) {                  buf[0] = (*keyservice)->id >> 8; | 
