From f5828b83d39757d24c8fe18eeac99fdd6e711fba Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Aug 2015 10:24:44 +0200 Subject: Correct deadline handling according to fillstatus --- src/fig/FIGCarousel.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/fig') diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp index 8986a18..6a463c7 100644 --- a/src/fig/FIGCarousel.cpp +++ b/src/fig/FIGCarousel.cpp @@ -49,7 +49,7 @@ void FIGCarouselElement::reduce_deadline() void FIGCarouselElement::increase_deadline() { - deadline += rate_increment_ms(fig->repetition_rate()); + deadline = rate_increment_ms(fig->repetition_rate()); std::cerr << "FIG " << fig->name() << " deadline increased to: " << deadline << std::endl; @@ -176,13 +176,14 @@ size_t FIGCarousel::carousel( if (written > 0) { available_size -= written; pbuf += written; - if (status.complete_fig_transmitted) { - (*fig0_0)->increase_deadline(); - } } else { throw std::runtime_error("Failed to write FIG0/0"); } + + if (status.complete_fig_transmitted) { + (*fig0_0)->increase_deadline(); + } } } @@ -199,10 +200,10 @@ size_t FIGCarousel::carousel( if (written > 0) { available_size -= written; pbuf += written; + } - if (status.complete_fig_transmitted) { - fig_el->increase_deadline(); - } + if (status.complete_fig_transmitted) { + fig_el->increase_deadline(); } sorted_figs.pop_front(); -- cgit v1.2.3