mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-02 14:28:32 +00:00
server: Simplify the MJPEG encoder's maximum framerate estimation
Note that if frame_size == bytes_per_sec == 0 this now returns MJPEG_MAX_FPS but this should not happen anyway. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
This commit is contained in:
parent
9b42aafe31
commit
4ce4c4a525
@ -341,15 +341,7 @@ static inline uint32_t mjpeg_encoder_get_latency(MJpegEncoder *encoder)
|
||||
|
||||
static uint32_t get_max_fps(uint64_t frame_size, uint64_t bytes_per_sec)
|
||||
{
|
||||
double fps;
|
||||
double send_time_ms;
|
||||
|
||||
if (!bytes_per_sec) {
|
||||
return 0;
|
||||
}
|
||||
send_time_ms = frame_size * 1000.0 / bytes_per_sec;
|
||||
fps = send_time_ms ? 1000 / send_time_ms : MJPEG_MAX_FPS;
|
||||
return fps;
|
||||
return frame_size ? bytes_per_sec / frame_size : MJPEG_MAX_FPS;
|
||||
}
|
||||
|
||||
static inline void mjpeg_encoder_reset_quality(MJpegEncoder *encoder,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user