[Spice-devel] [PATCH spice-server 01/28] red_worker: stream agent - fix miscounting of frames

Alon Levy alevy at redhat.com
Sun Apr 14 06:11:03 PDT 2013


On Tue, Feb 26, 2013 at 01:03:47PM -0500, Yonit Halperin wrote:
> Frames counting was skipped when the previous frame was already
> sent completely to the client.

ACK

> ---
>  server/red_worker.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 11fa126..a4a369a 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -3118,22 +3118,30 @@ static inline void pre_stream_item_swap(RedWorker *worker, Stream *stream)
>          if (pipe_item_is_linked(&dpi->dpi_pipe_item)) {
>              ++agent->drops;
>          }
> +    }
> +
>  
> +    WORKER_FOREACH_DCC(worker, ring_item, dcc) {
> +        double drop_factor;
> +
> +        agent = &dcc->stream_agents[index];
>          if (agent->frames / agent->fps < FPS_TEST_INTERVAL) {
>              agent->frames++;
> -            return;
> +            continue;
>          }
>  
> -        double drop_factor = ((double)agent->frames - (double)agent->drops) /
> -                             (double)agent->frames;
> -
> +        drop_factor = ((double)agent->frames - (double)agent->drops) /
> +            (double)agent->frames;
> +        spice_debug("stream %d: #frames %u #drops %u", index, agent->frames, agent->drops);
>          if (drop_factor == 1) {
>              if (agent->fps < MAX_FPS) {
>                  agent->fps++;
> +                spice_debug("stream %d: fps++ %u", index, agent->fps);
>              }
>          } else if (drop_factor < 0.9) {
>              if (agent->fps > 1) {
>                  agent->fps--;
> +                spice_debug("stream %d: fps--%u", index, agent->fps);
>              }
>          }
>          agent->frames = 1;
> -- 
> 1.8.1
> 
> _______________________________________________
> 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