diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2017-12-07 17:18:02 +0000 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2024-05-28 22:20:11 +0100 |
commit | 8e3eca717cb7dff2070f597272e093cadca78775 (patch) | |
tree | d4d01abf08b4a5a7a2709c03250c6743978a8988 | |
parent | 06ae076d655454b8ec89826a4d83288a22638a3a (diff) |
initialize VideoStreamAgent::stream in video-stream.c
avoid one function in header
-rw-r--r-- | server/dcc.cpp | 2 | ||||
-rw-r--r-- | server/video-stream.cpp | 2 | ||||
-rw-r--r-- | server/video-stream.h | 8 |
3 files changed, 2 insertions, 10 deletions
diff --git a/server/dcc.cpp b/server/dcc.cpp index d7680897..d2e37816 100644 --- a/server/dcc.cpp +++ b/server/dcc.cpp @@ -320,11 +320,9 @@ void dcc_add_drawable_after(DisplayChannelClient *dcc, Drawable *drawable, RedPi static void dcc_init_stream_agents(DisplayChannelClient *dcc) { int i; - DisplayChannel *display = DCC_TO_DC(dcc); for (i = 0; i < dcc->priv->stream_agents.size(); i++) { VideoStreamAgent *agent = &dcc->priv->stream_agents[i]; - agent->stream = streams_get_stream_from_id(&display->priv->streams_, i); region_init(&agent->vis_region); region_init(&agent->clip); } diff --git a/server/video-stream.cpp b/server/video-stream.cpp index 605c254d..69380f1b 100644 --- a/server/video-stream.cpp +++ b/server/video-stream.cpp @@ -755,6 +755,8 @@ static void video_stream_create_agent(VideoStream *stream, DisplayChannelClient int stream_id = streams_get_stream_id(streams, stream); VideoStreamAgent *agent = dcc_get_video_stream_agent(dcc, stream_id); + agent->stream = stream; + spice_return_if_fail(region_is_empty(&agent->vis_region)); if (stream->current) { diff --git a/server/video-stream.h b/server/video-stream.h index ed259498..503a131b 100644 --- a/server/video-stream.h +++ b/server/video-stream.h @@ -188,14 +188,6 @@ static inline int streams_get_stream_id(VideoStreams *streams, VideoStream *stre return stream->SPICE_PRIVATE(id); } -// TODO called only in dcc.c... maybe code should be moved in -// video-stream.c ?? -static inline VideoStream *streams_get_stream_from_id(VideoStreams *streams, int id) -{ - spice_assert(id >= 0 && id < NUM_STREAMS); - return &streams->SPICE_PRIVATE(streams_buf)[id]; -} - #include "pop-visibility.h" #endif /* VIDEO_STREAM_H_ */ |