Re: [Spice-devel] [PATCH spice-gtk] Fix occasional black screen at startup

2017-07-14 Thread Victor Toso
Hi,

On Thu, Jul 13, 2017 at 06:44:09PM +0200, Christophe de Dinechin wrote:
> From: Christophe de Dinechin 
>
> The problem occurs when we call spice_playback_channel_set_delay before
> the channel had received any data setting c->last_time, but after
> session initialization had set mm_time in the session. The result was
> that the (good) value in session->mm_time would be overwritten with 0.
>
> Signed-off-by: Christophe de Dinechin 
> ---
>  src/channel-playback.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/channel-playback.c b/src/channel-playback.c
> index ca14b96..f5acf23 100644
> --- a/src/channel-playback.c
> +++ b/src/channel-playback.c
> @@ -471,7 +471,8 @@ void 
> spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 del
>
>  session = spice_channel_get_session(SPICE_CHANNEL(channel));
>  if (session) {
> -spice_session_set_mm_time(session, c->last_time - delay_ms);
> +if (c->last_time != 0)
> +spice_session_set_mm_time(session, c->last_time - delay_ms);


I actually think we should not be setting mm_time in the client as this
could affect the audio/video sync that should be dictated by server.

This function was introduced in 2010, not much info on the rationale.

commit fbe3b5ec32e3d93f0a0f41239b85be723d8d91c5
Author: Marc-André Lureau 
Date:   Wed Dec 22 15:32:45 2010 +0100

gtk: update mm time based on playback time+delay

Running spice client without audio over h264 stream, makes the lag go
down a bit.

>  } else {
>  CHANNEL_DEBUG(channel, "channel detached from session, mm time 
> skipped");
>  }
> -- 
> 2.11.0 (Apple Git-81)
> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


signature.asc
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH spice-gtk] Fix occasional black screen at startup

2017-07-14 Thread Pavel Grunt
On Thu, 2017-07-13 at 18:44 +0200, Christophe de Dinechin wrote:
> From: Christophe de Dinechin 
> 
> The problem occurs when we call spice_playback_channel_set_delay before
> the channel had received any data setting c->last_time,

Interesting bug... setting the delay of the playback before the playback starts


>  but after
> session initialization had set mm_time in the session. The result was
> that the (good) value in session->mm_time would be overwritten with 0.
> 
> Signed-off-by: Christophe de Dinechin 
> ---
>  src/channel-playback.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/channel-playback.c b/src/channel-playback.c
> index ca14b96..f5acf23 100644
> --- a/src/channel-playback.c
> +++ b/src/channel-playback.c
> @@ -471,7 +471,8 @@ void spice_playback_channel_set_delay(SpicePlaybackChannel
> *channel, guint32 del
>  
>  session = spice_channel_get_session(SPICE_CHANNEL(channel));
>  if (session) {
> -spice_session_set_mm_time(session, c->last_time - delay_ms);
> +if (c->last_time != 0)
> +spice_session_set_mm_time(session, c->last_time - delay_ms);
>  } else {
>  CHANNEL_DEBUG(channel, "channel detached from session, mm time
> skipped");
>  }
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH spice-gtk] Fix occasional black screen at startup

2017-07-13 Thread Christophe de Dinechin
From: Christophe de Dinechin 

The problem occurs when we call spice_playback_channel_set_delay before
the channel had received any data setting c->last_time, but after
session initialization had set mm_time in the session. The result was
that the (good) value in session->mm_time would be overwritten with 0.

Signed-off-by: Christophe de Dinechin 
---
 src/channel-playback.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/channel-playback.c b/src/channel-playback.c
index ca14b96..f5acf23 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -471,7 +471,8 @@ void spice_playback_channel_set_delay(SpicePlaybackChannel 
*channel, guint32 del
 
 session = spice_channel_get_session(SPICE_CHANNEL(channel));
 if (session) {
-spice_session_set_mm_time(session, c->last_time - delay_ms);
+if (c->last_time != 0)
+spice_session_set_mm_time(session, c->last_time - delay_ms);
 } else {
 CHANNEL_DEBUG(channel, "channel detached from session, mm time 
skipped");
 }
-- 
2.11.0 (Apple Git-81)

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel