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

Victor Toso lists at victortoso.com
Tue Nov 24 03:08:59 PST 2015


Hi,

On Mon, Nov 23, 2015 at 04:39:14PM +0100, Francois Gouget wrote:
> 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.
>

Looks good.

Acked-by: Victor Toso <victortoso at redhat.com>

I'll push this if no one complains.

Cheers,
  -toso

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


More information about the Spice-devel mailing list