diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-07 15:45:25 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-08-07 15:45:25 +0200 |
commit | cdd4f414c25ee5f0f8a376abcba2adb7f3aa84f0 (patch) | |
tree | 9b7235b07a0560f439a5e23f3784319c5e2b81be | |
parent | 8222356f6c3dff6f66283c32354be033898749fc (diff) | |
download | dabmux-cdd4f414c25ee5f0f8a376abcba2adb7f3aa84f0.tar.gz dabmux-cdd4f414c25ee5f0f8a376abcba2adb7f3aa84f0.tar.bz2 dabmux-cdd4f414c25ee5f0f8a376abcba2adb7f3aa84f0.zip |
Add FIB2 insertion
-rw-r--r-- | src/DabMultiplexer.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index e775c96..e9fb0c1 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -1115,7 +1115,7 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu if (figSize > 30) { etiLog.log(error, - "FIG too big (%i > 30)\n", figSize); + "FIB0 overload (%i > 30)\n", figSize); throw MuxInitException(); } @@ -1512,7 +1512,12 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu break; } - assert(figSize <= 30); + if (figSize > 30) { + etiLog.log(error, + "FIB1 overload (%i > 30)\n", figSize); + throw MuxInitException(); + } + memcpy(&etiFrame[index], Padding_FIB, 30 - figSize); index += 30 - figSize; @@ -1525,7 +1530,11 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu figSize = 0; // FIB 2 insertion - if (rotateFIB < ensemble->services.size()) { + if (new_fig_carousel) { + figSize += fig_carousel.carousel(2, &etiFrame[index], 30, currentFrame % 4); + index += figSize; + } + else if (rotateFIB < ensemble->services.size()) { service = ensemble->services.begin() + rotateFIB; // FIG type 1/1, SI, Service label, one instance per subchannel @@ -1615,6 +1624,12 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu figSize += 2; } } + + if (figSize > 30) { + etiLog.log(error, + "FIB2 overload (%i > 30)\n", figSize); + throw MuxInitException(); + } memcpy(&etiFrame[index], Padding_FIB, 30 - figSize); index += 30 - figSize; @@ -1630,6 +1645,7 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu */ if (ensemble->mode == 3) { memcpy(&etiFrame[index], Padding_FIB, 30); + /* Fill FIB3 with padding */ index += 30; CRCtmp = 0xffff; @@ -1639,7 +1655,8 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu etiFrame[index++] = ((char *) &CRCtmp)[0]; } - if (ensemble->services.size() > 30) { + if ( !new_fig_carousel and + ensemble->services.size() > 30) { etiLog.log(error, "Sorry, but this software currently can't write " "Service Label of more than 30 services.\n"); |