[Spice-commits] server/mjpeg-encoder.c
Christophe Fergau
teuf at kemper.freedesktop.org
Tue Dec 8 07:24:17 PST 2015
server/mjpeg-encoder.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
New commits:
commit 4ce4c4a5252a90cb0594e7fec2b183c69a66e77f
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Dec 3 18:50:25 2015 +0100
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 at codeweavers.com>
diff --git a/server/mjpeg-encoder.c b/server/mjpeg-encoder.c
index 1443687..3f54112 100644
--- a/server/mjpeg-encoder.c
+++ b/server/mjpeg-encoder.c
@@ -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,
More information about the Spice-commits
mailing list