]> git.sesse.net Git - nageru/blobdiff - nageru/x264_speed_control.cpp
Fix a Clang 19 warning.
[nageru] / nageru / x264_speed_control.cpp
index 81e98a7d39f4966e0e88a6c693a7dc9fb57cc2cf..0c7e7e8632b689fd06460cc6dae7486a53f24d95 100644 (file)
@@ -3,15 +3,15 @@
 #include <dlfcn.h>
 #include <math.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <x264.h>
 #include <algorithm>
 #include <chrono>
 #include <cmath>
-#include <ratio>
-#include <type_traits>
 
 #include "flags.h"
 #include "shared/metrics.h"
+#include "x264_dynamic.h"
 
 using namespace std;
 using namespace std::chrono;
@@ -208,17 +208,6 @@ void X264SpeedControl::before_frame(float new_buffer_fill, int new_buffer_size,
        stat.max_buffer = max(buffer_fill, stat.max_buffer);
 
        if (buffer_fill >= buffer_size) { // oops, cpu was idle
-               // not really an error, but we'll warn for debugging purposes
-               static int64_t idle_t = 0;
-               static steady_clock::time_point print_interval;
-               static bool first = false;
-               idle_t += buffer_fill - buffer_size;
-               if (first || duration<double>(t - print_interval).count() > 0.1) {
-                       //fprintf(stderr, "speedcontrol idle (%.6f sec)\n", idle_t/1e6);
-                       print_interval = t;
-                       idle_t = 0;
-                       first = false;
-               }
                buffer_fill = buffer_size;
                metric_x264_speedcontrol_buffer_available_seconds = buffer_fill * 1e-6;
                ++metric_x264_speedcontrol_idle_frames;