]> git.sesse.net Git - nageru/blobdiff - x264_encoder.cpp
Rename ui_foo.ui to foo.ui; seemingly, it is more standard.
[nageru] / x264_encoder.cpp
index ccf6942e1813ef7aa4748b45b531d108dd06d64f..8463d1bae285744a420aa47a1155504eb3f07b00 100644 (file)
@@ -150,6 +150,9 @@ void X264Encoder::init_x264()
        if (global_flags.x264_speedcontrol) {
                param.i_frame_reference = 16;  // Because speedcontrol is never allowed to change this above what we set at start.
        }
+#if X264_BUILD >= 153
+       param.i_bitdepth = global_flags.x264_bit_depth;
+#endif
 
        // NOTE: These should be in sync with the ones in quicksync_encoder.cpp (sps_rbsp()).
        param.vui.i_vidformat = 5;  // Unspecified.
@@ -343,7 +346,12 @@ void X264Encoder::encode_frame(X264Encoder::QueuedFrame qf)
        }
 
        if (speed_control) {
-               speed_control->before_frame(float(free_frames.size()) / X264_QUEUE_LENGTH, X264_QUEUE_LENGTH, 1e6 * qf.duration / TIMEBASE);
+               float queue_fill_ratio;
+               {
+                       lock_guard<mutex> lock(mu);
+                       queue_fill_ratio = float(free_frames.size()) / X264_QUEUE_LENGTH;
+               }
+               speed_control->before_frame(queue_fill_ratio, X264_QUEUE_LENGTH, 1e6 * qf.duration / TIMEBASE);
        }
        dyn.x264_encoder_encode(x264, &nal, &num_nal, input_pic, &pic);
        if (speed_control) {