diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-08-01 12:07:51 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-08-01 12:07:51 +0200 |
commit | 0ebce6201e7501b43adc95a394117d1060b3a65e (patch) | |
tree | 947ff3ab2f0abf941d3baa2bb62b05625fe00d30 /src/MuxElements.cpp | |
parent | a95438527f2db7a1535ce679edde004b982dba60 (diff) | |
download | dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.gz dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.tar.bz2 dabmux-0ebce6201e7501b43adc95a394117d1060b3a65e.zip |
Refactor protection handling for better readability
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 4dd226b..6ecbcf5 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -437,14 +437,15 @@ const string dabEnsemble::get_parameter(const string& parameter) const unsigned short getSizeCu(dabSubchannel* subchannel) { - if (subchannel->protection.form == 0) { + if (subchannel->protection.form == UEP) { return Sub_Channel_SizeTable[subchannel-> - protection.shortForm.tableIndex]; - } else { - dabProtectionLong* protection = - &subchannel->protection.longForm; - switch (protection->option) { - case 0: + protection.uep.tableIndex]; + } + else if (subchannel->protection.form == EEP) { + dabProtectionEEP* protection = + &subchannel->protection.eep; + switch (protection->profile) { + case EEP_A: switch (subchannel->protection.level) { case 0: return (subchannel->bitrate * 12) >> 3; @@ -464,7 +465,7 @@ unsigned short getSizeCu(dabSubchannel* subchannel) return 0; } break; - case 1: + case EEP_B: switch (subchannel->protection.level) { case 0: return (subchannel->bitrate * 27) >> 5; |