[PATCH 2/2] server: Remove MJPEG's video callback assert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 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
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]