summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2017-12-07 10:50:28 +0000
committerFrediano Ziglio <freddy77@gmail.com>2024-05-28 22:20:11 +0100
commit076c4c27df2c3b95b287c01d5ab3a2d53830bb13 (patch)
treee3476809b46c5267ae6ade5063c34e6be8fdabfb
parent80af8eec39cbf7a532b6b6e84d67d2abbe955545 (diff)
remove useless check
currently is_connected returns if there are clients if there are no clients there are also no item in the pipes this remove a dependency from DisplayChannel
-rw-r--r--server/video-stream.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/server/video-stream.cpp b/server/video-stream.cpp
index 3f874d94..1fa6c1a3 100644
--- a/server/video-stream.cpp
+++ b/server/video-stream.cpp
@@ -334,10 +334,9 @@ void video_stream_detach_drawable(VideoStream *stream)
stream->current = nullptr;
}
-static void before_reattach_stream(DisplayChannel *display,
+static void before_reattach_stream(VideoStreams *streams,
VideoStream *stream, Drawable *new_frame)
{
- VideoStreams *streams = &display->priv->streams_;
DisplayChannelClient *dcc;
int index;
VideoStreamAgent *agent;
@@ -345,10 +344,6 @@ static void before_reattach_stream(DisplayChannel *display,
spice_return_if_fail(stream->current);
- if (!display->is_connected()) {
- return;
- }
-
if (new_frame->process_commands_generation == stream->current->process_commands_generation) {
spice_debug("ignoring drop, same process_commands_generation as previous frame");
return;
@@ -526,7 +521,7 @@ void video_stream_trace_update(DisplayChannel *display, Drawable *drawable)
if (is_next_frame) {
if (stream->current) {
stream->current->streamable = FALSE; //prevent item trace
- before_reattach_stream(display, stream, drawable);
+ before_reattach_stream(streams, stream, drawable);
video_stream_detach_drawable(stream);
}
attach_stream(display, drawable, stream);
@@ -549,6 +544,7 @@ void video_stream_trace_update(DisplayChannel *display, Drawable *drawable)
void video_stream_maintenance(DisplayChannel *display,
Drawable *candidate, Drawable *prev)
{
+ VideoStreams *streams = &display->priv->streams_;
bool is_next_frame;
if (candidate->stream) {
@@ -563,7 +559,7 @@ void video_stream_maintenance(DisplayChannel *display,
&stream->dest_area, stream->last_time,
stream, TRUE);
if (is_next_frame) {
- before_reattach_stream(display, stream, candidate);
+ before_reattach_stream(streams, stream, candidate);
video_stream_detach_drawable(stream);
prev->streamable = FALSE; //prevent item trace
attach_stream(display, candidate, stream);