diff --git a/virtio-snd.c b/virtio-snd.c index d0c5448..b41a1d4 100644 --- a/virtio-snd.c +++ b/virtio-snd.c @@ -14,7 +14,7 @@ #define VSND_QUEUE_NUM_MAX 1024 #define vsndq (vsnd->queues[vsnd->QueueSel]) -#define PRIV(x) ((struct virtio_snd_config_t *) x->priv) +#define PRIV(x) ((virtio_snd_config_t *) x->priv) /* supported virtio sound version */ enum { @@ -721,11 +721,14 @@ bool virtio_snd_init(virtio_snd_state_t *vsnd) audio_host = CNFAInit(NULL, "semu-virtio-snd", virtio_snd_cb, 44100, 0, 1, 0, 1024, NULL, NULL, &guest_playing); - if (!audio_host) { fprintf(stderr, "virtio-snd driver initialization failed.\n"); return false; } + PRIV(vsnd)->jacks = 1; + PRIV(vsnd)->streams = 1; + PRIV(vsnd)->chmaps = 1; + return true; }