]> git.sesse.net Git - nageru/commitdiff
Update the queue length metric after trimming, not before.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 15 Jun 2017 17:33:01 +0000 (19:33 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 15 Jun 2017 17:33:01 +0000 (19:33 +0200)
mixer.cpp

index 4560bbb4976fc74b497c24e16ceee465f52c33db..6846d83ffdbaef73420d638cc1b282ce11cb02a3 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -207,8 +207,6 @@ void QueueLengthPolicy::register_metrics(const vector<pair<string, string>> &lab
 
 void QueueLengthPolicy::update_policy(unsigned queue_length)
 {
 
 void QueueLengthPolicy::update_policy(unsigned queue_length)
 {
-       metric_input_queue_length_frames = queue_length;
-
        if (queue_length == 0) {  // Starvation.
                if (been_at_safe_point_since_last_starvation && safe_queue_length < unsigned(global_flags.max_input_queue_frames)) {
                        ++safe_queue_length;
        if (queue_length == 0) {  // Starvation.
                if (been_at_safe_point_since_last_starvation && safe_queue_length < unsigned(global_flags.max_input_queue_frames)) {
                        ++safe_queue_length;
@@ -1047,6 +1045,7 @@ void Mixer::trim_queue(CaptureCard *card, unsigned card_index)
                ++dropped_frames;
        }
 
                ++dropped_frames;
        }
 
+       metric_input_queue_length_frames = queue_length;
        card->metric_input_dropped_frames_jitter += dropped_frames;
 
 #if 0
        card->metric_input_dropped_frames_jitter += dropped_frames;
 
 #if 0