mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] spice: correct issue with new channel list support
This commit is contained in:
parent
daf854c692
commit
07e4c1c20f
@ -40,10 +40,17 @@ typedef struct SpiceMsgMainInit
|
||||
}
|
||||
SpiceMsgMainInit;
|
||||
|
||||
typedef struct SpiceChannelID
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t channel_id;
|
||||
}
|
||||
SpiceChannelID;
|
||||
|
||||
typedef struct SpiceMsgMainChannelsList
|
||||
{
|
||||
uint32_t num_of_channels;
|
||||
//uint8_t channels[num_of_channels]
|
||||
//SpiceChannelID channels[num_of_channels]
|
||||
}
|
||||
SpiceMainChannelsList;
|
||||
|
||||
|
@ -442,8 +442,8 @@ bool spice_on_main_channel_read()
|
||||
}
|
||||
|
||||
// documentation doesn't state that the array is null terminated but it seems that it is
|
||||
uint8_t channels[msg.num_of_channels+1];
|
||||
if (!spice_read(channel, &channels, msg.num_of_channels+1))
|
||||
SpiceChannelID channels[msg.num_of_channels];
|
||||
if (!spice_read(channel, &channels, msg.num_of_channels * sizeof(SpiceChannelID)))
|
||||
{
|
||||
DEBUG_ERROR("Failed to read channel list vector");
|
||||
spice_disconnect();
|
||||
@ -452,8 +452,8 @@ bool spice_on_main_channel_read()
|
||||
|
||||
for(int i = 0; i < msg.num_of_channels; ++i)
|
||||
{
|
||||
DEBUG_PROTO("channel %d = %u", i, channels[i]);
|
||||
if (channels[i] == SPICE_CHANNEL_INPUTS)
|
||||
DEBUG_PROTO("channel %d = %u", i, channels[i].type);
|
||||
if (channels[i].type == SPICE_CHANNEL_INPUTS)
|
||||
{
|
||||
if (spice.scInputs.connected)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user