diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 18fc956f0..0c38e480d 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1322,6 +1322,12 @@ static void xf_post_disconnect(freerdp* instance) xfc->drawable = NULL; else xf_DestroyDummyWindow(xfc, xfc->drawable); + + if (xfc->xfVideo) + { + xf_video_free(xfc->xfVideo); + xfc->xfVideo = NULL; + } xf_window_free(xfc); xf_keyboard_free(xfc); diff --git a/client/X11/xf_video.c b/client/X11/xf_video.c index 37045299a..6548328c6 100644 --- a/client/X11/xf_video.c +++ b/client/X11/xf_video.c @@ -202,7 +202,11 @@ xfVideoContext *xf_video_new(xfContext *xfc) } ret->xfc = xfc; - ret->lastSentRate = XF_VIDEO_UNLIMITED_RATE; + + /* don't set to unlimited so that we have the chance to send a feedback in + * the first second (for servers that want feedback directly) + */ + ret->lastSentRate = 30; return ret; error_spinlock: @@ -214,8 +218,6 @@ error_frames: return NULL; } - - void xf_video_geometry_init(xfContext *xfc, GeometryClientContext *geom) { xfc->geometry = geom; @@ -617,9 +619,10 @@ static UINT xf_video_VideoData(VideoClientContext* context, TSMM_VIDEO_DATA *dat return CHANNEL_RC_OK; } -static void xf_video_free(xfVideoContext *xfVideo) +void xf_video_free(xfVideoContext *xfVideo) { - xfVideo->xfc->video->VideoData = NULL; + if (xfVideo->xfc->video) + xfVideo->xfc->video->VideoData = NULL; EnterCriticalSection(&xfVideo->framesLock); while (Queue_Count(xfVideo->frames)) @@ -652,6 +655,7 @@ void xf_video_control_init(xfContext *xfc, VideoClientContext *video) void xf_video_control_uninit(xfContext *xfc, VideoClientContext *video) { xf_video_free(xfc->xfVideo); + xfc->xfVideo = NULL; } diff --git a/client/X11/xf_video.h b/client/X11/xf_video.h index f12d0d527..9da1e706a 100644 --- a/client/X11/xf_video.h +++ b/client/X11/xf_video.h @@ -35,6 +35,7 @@ void xf_video_data_init(xfContext *xfc, VideoClientContext *video); void xf_video_data_uninit(xfContext *xfc, VideoClientContext *context); xfVideoContext *xf_video_new(xfContext *xfc); +void xf_video_free(xfVideoContext *context); #endif /* CLIENT_X11_XF_VIDEO_H_ */