aboutsummaryrefslogtreecommitdiff
path: root/hw/pcspk.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-05-12 12:33:04 +0100
committerPaul Brook <paul@codesourcery.com>2009-05-12 12:33:04 +0100
commit22d83b140e7b2dda555b7e3035050454f8764b7f (patch)
treeb80cd7f2cbae7951323871218db3772dd8b3b8c7 /hw/pcspk.c
parent0d9acba8fddbf970c7353083e6a60b47017ce3e4 (diff)
downloadqemu-22d83b140e7b2dda555b7e3035050454f8764b7f.zip
qemu-22d83b140e7b2dda555b7e3035050454f8764b7f.tar.gz
qemu-22d83b140e7b2dda555b7e3035050454f8764b7f.tar.bz2
Push AUD_init down to devices
Now we can safely call AUD_init multiple times we can push it down to individual audio devices, rather than having to pass it from the board init. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/pcspk.c')
-rw-r--r--hw/pcspk.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/pcspk.c b/hw/pcspk.c
index ec1d0c6..0dad161 100644
--- a/hw/pcspk.c
+++ b/hw/pcspk.c
@@ -96,15 +96,12 @@ static void pcspk_callback(void *opaque, int free)
}
}
-int pcspk_audio_init(AudioState *audio, qemu_irq *pic)
+int pcspk_audio_init(qemu_irq *pic)
{
+ AudioState *audio = AUD_init();
PCSpkState *s = &pcspk_state;
struct audsettings as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
- if (!audio) {
- AUD_log(s_spk, "No audio state\n");
- return -1;
- }
AUD_register_card(audio, s_spk, &s->card);
s->voice = AUD_open_out(&s->card, s->voice, s_spk, s, pcspk_callback, &as);