summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2015-11-23 16:39:14 +0100
committerVictor Toso <victortoso@redhat.com>2015-11-25 09:51:23 +0100
commit9e5363d483f5b1e58ee80fbac8522075d0f8f8f2 (patch)
treea50480484a123a1f9df2dac799ff6378eb069f6e /server
parent751576b173bdf3920a337a559d697ee695b4b8d4 (diff)
downloadspice-9e5363d483f5b1e58ee80fbac8522075d0f8f8f2.zip
spice-9e5363d483f5b1e58ee80fbac8522075d0f8f8f2.tar.gz
spice-9e5363d483f5b1e58ee80fbac8522075d0f8f8f2.tar.xz
server: Remove MJPEG's video callback assert
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@codeweavers.com>
Diffstat (limited to 'server')
-rw-r--r--server/mjpeg_encoder.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index f7348da..9b331c1 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -329,7 +329,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)
@@ -1347,8 +1348,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;