[Spice-devel] server: Simplify the MJPEG encoder's maximum framerate estimation
Francois Gouget
fgouget at codeweavers.com
Thu Dec 3 09:52:27 PST 2015
On Thu, 3 Dec 2015, Frediano Ziglio wrote:
[...]
> I think the exact simplification is
>
> if (!bytes_per_sec) {
> return 0;
> }
> return frame_size ? bytes_per_sec / frame_size : MJPEG_MAX_FPS;
>
> You already noted that you used rounding instead or truncation;
> depending on the usage can be correct or not.
The function seems to be meant to return the maximum safe framerate so
always rounding down may indeed be better. I resent the patch and added
a note in the commit log for the bytes_per_sec == frame_size == 0 case.
--
Francois Gouget <fgouget at codeweavers.com>
More information about the Spice-devel
mailing list