summaryrefslogtreecommitdiffstats
path: root/src/fig/FIGCarousel.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-19 19:02:35 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-19 19:02:35 +0200
commit42970488bba01fdecab1b9f2f7df60c4998e7680 (patch)
tree908ae5471f63e7d81f47a66900d2e98b236a39a8 /src/fig/FIGCarousel.cpp
parent9d109d386e465dc4ea46159b0a7191ac30454a6d (diff)
downloaddabmux-42970488bba01fdecab1b9f2f7df60c4998e7680.tar.gz
dabmux-42970488bba01fdecab1b9f2f7df60c4998e7680.tar.bz2
dabmux-42970488bba01fdecab1b9f2f7df60c4998e7680.zip
Increment/Decrement deadline correctly
Diffstat (limited to 'src/fig/FIGCarousel.cpp')
-rw-r--r--src/fig/FIGCarousel.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp
index 0e3742c..7f3721b 100644
--- a/src/fig/FIGCarousel.cpp
+++ b/src/fig/FIGCarousel.cpp
@@ -32,8 +32,12 @@
/**************** FIGCarouselElement ****************/
void FIGCarouselElement::reduce_deadline()
{
-#error "Wrong: deadline should decrement identically for all FIGs"
- deadline -= rate_increment_ms(fig->repetition_rate());
+ deadline -= 24; //ms
+}
+
+void FIGCarouselElement::increase_deadline()
+{
+ deadline += rate_increment_ms(fig->repetition_rate());
std::cerr << "FIG " << fig->name() <<
" deadline: " << deadline << std::endl;
@@ -102,7 +106,7 @@ size_t FIGCarousel::fib0(uint8_t *buf, size_t bufsize, int framephase) {
std::vector<FIGCarouselElement> sorted_figs;
- /* Decrement all deadlines according to the desired repetition rate */
+ /* Decrement all deadlines */
for (auto& fig_el : figs) {
fig_el.reduce_deadline();
@@ -154,6 +158,8 @@ size_t FIGCarousel::fib0(uint8_t *buf, size_t bufsize, int framephase) {
if (written > 0) {
available_size -= written;
buf += written;
+
+ fig_el->increase_deadline();
}
sorted_figs.erase(fig_el);