diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-10 08:44:54 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-10 08:44:54 +0200 |
commit | eccfa8ad3774205a929ff70090540d24674618a1 (patch) | |
tree | efd09912de551913402e75d0a5e52aa6363b6736 /src/fig/FIGCarousel.cpp | |
parent | 39d6a781bbd9073aba30db15f57d8ce3c3e3ab92 (diff) | |
download | dabmux-eccfa8ad3774205a929ff70090540d24674618a1.tar.gz dabmux-eccfa8ad3774205a929ff70090540d24674618a1.tar.bz2 dabmux-eccfa8ad3774205a929ff70090540d24674618a1.zip |
Simplify FIG allocation code in carousel
Diffstat (limited to 'src/fig/FIGCarousel.cpp')
-rw-r--r-- | src/fig/FIGCarousel.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp index cbea12b..63226e0 100644 --- a/src/fig/FIGCarousel.cpp +++ b/src/fig/FIGCarousel.cpp @@ -111,11 +111,11 @@ FIGCarousel::FIGCarousel(std::shared_ptr<dabEnsemble> ensemble) : void FIGCarousel::load_and_allocate(IFIG& fig, FIBAllocation fib) { - int type = fig.figtype(); - int extension = fig.figextension(); - - m_figs_available[std::make_pair(type, extension)] = &fig; - allocate_fig_to_fib(type, extension, fib); + FIGCarouselElement el; + el.fig = &fig; + el.deadline = 0; + el.increase_deadline(); + m_fibs[fib].push_back(el); } void FIGCarousel::update(unsigned long currentFrame) @@ -123,24 +123,6 @@ void FIGCarousel::update(unsigned long currentFrame) m_rti.currentFrame = currentFrame; } -void FIGCarousel::allocate_fig_to_fib(int figtype, int extension, FIBAllocation fib) -{ - auto fig = m_figs_available.find(std::make_pair(figtype, extension)); - - if (fig != m_figs_available.end()) { - FIGCarouselElement el; - el.fig = fig->second; - el.deadline = 0; - el.increase_deadline(); - m_fibs[fib].push_back(el); - } - else { - std::stringstream ss; - ss << "No FIG " << figtype << "/" << extension << " available"; - throw std::runtime_error(ss.str()); - } -} - void dumpfib(const uint8_t *buf, size_t bufsize) { std::cerr << "FIB "; for (size_t i = 0; i < bufsize; i++) { |