X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fx264_speed_control.cpp;h=0c7e7e8632b689fd06460cc6dae7486a53f24d95;hb=HEAD;hp=5240347d8375806647ca347be6d0154fb5836da3;hpb=eeda8995329601f9f4e35047358400833eeae68e;p=nageru diff --git a/nageru/x264_speed_control.cpp b/nageru/x264_speed_control.cpp index 5240347..0c7e7e8 100644 --- a/nageru/x264_speed_control.cpp +++ b/nageru/x264_speed_control.cpp @@ -3,15 +3,15 @@ #include #include #include +#include #include #include #include #include -#include -#include #include "flags.h" #include "shared/metrics.h" +#include "x264_dynamic.h" using namespace std; using namespace std::chrono; @@ -19,7 +19,7 @@ using namespace std::chrono; #define SC_PRESETS 23 X264SpeedControl::X264SpeedControl(x264_t *x264, float f_speed, int i_buffer_size, float f_buffer_init) - : dyn(load_x264_for_bit_depth(global_flags.x264_bit_depth)), + : dyn(load_x264_for_bit_depth(global_flags.bit_depth)), x264(x264), f_speed(f_speed) { x264_param_t param; @@ -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(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;