mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 17:49:02 +00:00
video-stream: Don't stop a stream associated with gl_draw (v2)
We do not want to stop a stream associated with gl_draw as a result of timeout because we may not get another opportunity to create a new stream if the current one gets stopped. However, when the stream does get stopped for other reasons, we need to clear the gl_draw_stream pointer associated with the relevant DC. v2: (suggestions from Frediano) - Don't stop the stream regardless of whether gl_draw is ongoing or not Cc: Frediano Ziglio <freddy77@gmail.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Dongwon Kim <dongwon.kim@intel.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
parent
5a6c03292d
commit
ddc3358818
@ -116,6 +116,10 @@ void video_stream_stop(DisplayChannel *display, VideoStream *stream)
|
||||
}
|
||||
dcc->pipe_add(video_stream_destroy_item_new(stream_agent));
|
||||
video_stream_agent_stats_print(stream_agent);
|
||||
|
||||
if (stream == display->priv->gl_draw_stream) {
|
||||
display->priv->gl_draw_stream = nullptr;
|
||||
}
|
||||
}
|
||||
display->priv->streams_size_total -= stream->width * stream->height;
|
||||
ring_remove(&stream->link);
|
||||
@ -1076,7 +1080,8 @@ void video_stream_timeout(DisplayChannel *display)
|
||||
while (item) {
|
||||
VideoStream *stream = SPICE_CONTAINEROF(item, VideoStream, link);
|
||||
item = ring_next(ring, item);
|
||||
if (now >= (stream->last_time + RED_STREAM_TIMEOUT)) {
|
||||
if (now >= (stream->last_time + RED_STREAM_TIMEOUT) &&
|
||||
stream != display->priv->gl_draw_stream) {
|
||||
detach_video_stream_gracefully(display, stream, nullptr);
|
||||
video_stream_stop(display, stream);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user