test-playback: Pass proper types to spice_server_add_interface

This is a revert of b76e561d.
For a SpicePlaybackInstance, the base interface must be a
SpicePlaybackInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Christophe Fergeau 2017-01-26 18:31:23 +01:00
parent 1afa86c3ee
commit f5494cfa9b

View File

@ -36,11 +36,11 @@
SpicePlaybackInstance playback_instance;
static const SpiceBaseInterface base = {
.type = SPICE_INTERFACE_PLAYBACK,
.description = "test playback",
.major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
.minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
static const SpicePlaybackInterface playback_sif = {
.base.type = SPICE_INTERFACE_PLAYBACK,
.base.description = "test playback",
.base.major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
.base.minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
};
uint32_t *frame;
@ -112,7 +112,7 @@ int main(void)
spice_server_set_noauth(server);
spice_server_init(server, core);
playback_instance.base.sif = &base;
playback_instance.base.sif = &playback_sif.base;
spice_server_add_interface(server, &playback_instance.base);
spice_server_playback_start(&playback_instance);