<div dir="ltr">ack<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 13, 2015 at 10:25 PM, Francois Gouget <span dir="ltr"><<a href="mailto:fgouget@codeweavers.com" target="_blank">fgouget@codeweavers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The checks would lead the reader to think these functions can be called<br>
when bit rate control is off when in fact they are only called when it<br>
is active.<br>
---<br>
<br>
This patch makes sense independently from the rest of the series.<br>
<br>
server/mjpeg_encoder.c | 9 +++------<br>
1 file changed, 3 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c<br>
index 12447da..95d841f 100644<br>
--- a/server/mjpeg_encoder.c<br>
+++ b/server/mjpeg_encoder.c<br>
@@ -607,9 +607,7 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder)<br>
uint32_t latency = 0;<br>
uint32_t src_fps;<br>
<br>
- if (!encoder->rate_control_is_active) {<br>
- return;<br>
- }<br>
+ spice_assert(encoder->rate_control_is_active);<br>
<br>
rate_control = &encoder->rate_control;<br>
quality_eval = &rate_control->quality_eval_data;<br>
@@ -694,9 +692,8 @@ static void mjpeg_encoder_adjust_fps(MJpegEncoder *encoder, uint64_t now)<br>
MJpegEncoderRateControl *rate_control = &encoder->rate_control;<br>
uint64_t adjusted_fps_time_passed;<br>
<br>
- if (!encoder->rate_control_is_active) {<br>
- return;<br>
- }<br>
+ spice_assert(encoder->rate_control_is_active);<br>
+<br>
adjusted_fps_time_passed = (now - rate_control->adjusted_fps_start_time) / 1000 / 1000;<br>
<br>
if (!rate_control->during_quality_eval &&<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Marc-André Lureau</div>
</div>