diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-31 22:35:17 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-01-31 22:35:17 +0100 |
commit | 5ac4621df043666836107e0e0aaa3df709fb866e (patch) | |
tree | b11ea1bff6c671597adcc46ed8dfe2593fee38a9 /src/FrameMultiplexer.cpp | |
parent | f607e5406666dbd1646b427af9b46c956829a773 (diff) | |
download | dabmod-5ac4621df043666836107e0e0aaa3df709fb866e.tar.gz dabmod-5ac4621df043666836107e0e0aaa3df709fb866e.tar.bz2 dabmod-5ac4621df043666836107e0e0aaa3df709fb866e.zip |
Restart when FrameMultiplexer sees a different configuration
Diffstat (limited to 'src/FrameMultiplexer.cpp')
-rw-r--r-- | src/FrameMultiplexer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/FrameMultiplexer.cpp b/src/FrameMultiplexer.cpp index efd43f3..ffae2ca 100644 --- a/src/FrameMultiplexer.cpp +++ b/src/FrameMultiplexer.cpp @@ -77,11 +77,17 @@ int FrameMultiplexer::process(std::vector<Buffer*> dataIn, Buffer* dataOut) memcpy(out, (*in)->getData(), (*in)->getLength()); ++in; // Write subchannel - assert(mySubchannels->size() == dataIn.size() - 1); + if (mySubchannels->size() != dataIn.size() - 1) { + throw std::out_of_range( + "FrameMultiplexer detected subchannel size change!"); + } std::vector<std::shared_ptr<SubchannelSource> >::const_iterator subchannel = mySubchannels->begin(); while (in != dataIn.end()) { - assert((*subchannel)->framesizeCu() * 8 == (*in)->getLength()); + if ((*subchannel)->framesizeCu() * 8 != (*in)->getLength()) { + throw std::out_of_range( + "FrameMultiplexer detected invalid subchannel size!"); + } size_t offset = (*subchannel)->startAddress() * 8; memcpy(&out[offset], (*in)->getData(), (*in)->getLength()); ++in; |