[Spice-devel] [PATCH 2/2] server: Remove MJPEG's video callback assert
Francois Gouget
fgouget at codeweavers.com
Mon Nov 23 07:39:14 PST 2015
A NULL get_roundtrip_ms() callback simply disables rate control so
that mjpeg_encoder_get_source_fps() will not be called.
Should it be called despite this, simply return the highest allowed
framerate (get_source_fps()'s value is only an estimate anyway).
Finally update_client_playback_delay() is always checked before use.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
server/mjpeg_encoder.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index 946ce8b..ee54351 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -330,7 +330,8 @@ spice_jpeg_mem_dest(j_compress_ptr cinfo,
static inline uint32_t mjpeg_encoder_get_source_fps(MJpegEncoder *encoder)
{
- return encoder->cbs.get_source_fps(encoder->cbs_opaque);
+ return encoder->cbs.get_source_fps ?
+ encoder->cbs.get_source_fps(encoder->cbs_opaque) : MJPEG_MAX_FPS;
}
static inline uint32_t mjpeg_encoder_get_latency(MJpegEncoder *encoder)
@@ -1348,8 +1349,6 @@ MJpegEncoder *mjpeg_encoder_new(uint64_t starting_bit_rate,
{
MJpegEncoder *encoder = spice_new0(MJpegEncoder, 1);
- spice_assert(!cbs || (cbs && cbs->get_roundtrip_ms && cbs->get_source_fps));
-
encoder->first_frame = TRUE;
encoder->rate_control.byte_rate = starting_bit_rate / 8;
encoder->starting_bit_rate = starting_bit_rate;
--
2.6.2
More information about the Spice-devel
mailing list