On Fri, Jun 30, 2017 at 12:51:16PM +0200, Victor Toso wrote: > From: Victor Toso <me@xxxxxxxxxxxxxx> > > Including some comment about current implementation of stream-id value > in the Spice. > > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> > --- > src/channel-display.c | 42 +++++++++++++++++++++++++++++++----------- > 1 file changed, 31 insertions(+), 11 deletions(-) > > diff --git a/src/channel-display.c b/src/channel-display.c > index 06c503c..9ae2851 100644 > --- a/src/channel-display.c > +++ b/src/channel-display.c > @@ -105,6 +105,7 @@ static void channel_set_handlers(SpiceChannelClass *klass); > > static void clear_surfaces(SpiceChannel *channel, gboolean keep_primary); > static void clear_streams(SpiceChannel *channel); > +static void streams_check_init(SpiceChannel *channel, guint stream_id); > static display_surface *find_surface(SpiceDisplayChannelPrivate *c, guint32 surface_id); > static void spice_display_channel_reset(SpiceChannel *channel, gboolean migrating); > static void spice_display_channel_reset_capabilities(SpiceChannel *channel); > @@ -1233,17 +1234,7 @@ static void display_handle_stream_create(SpiceChannel *channel, SpiceMsgIn *in) > > CHANNEL_DEBUG(channel, "%s: id %u", __FUNCTION__, op->id); > > - if (op->id >= c->nstreams) { > - int n = c->nstreams; > - if (!c->nstreams) { > - c->nstreams = 1; > - } > - while (op->id >= c->nstreams) { > - c->nstreams *= 2; > - } > - c->streams = realloc(c->streams, c->nstreams * sizeof(c->streams[0])); > - memset(c->streams + n, 0, (c->nstreams - n) * sizeof(c->streams[0])); > - } What about making this g_array_set_size(c->streams, op->id);? Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel