summaryrefslogtreecommitdiff
path: root/audio/ossaudio.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-06 08:40:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-03-12 11:18:26 +0100
commitd3893a39eb0165809325071ab07984797d78e57a (patch)
treead48738682ee38a743635bc79a99c62515f3998b /audio/ossaudio.c
parenta88afc649e53adc1cac00bb5803fbafdd4d99994 (diff)
downloadqemu-d3893a39eb0165809325071ab07984797d78e57a.tar.gz
audio: add driver registry
Add registry for audio drivers, using the existing audio_driver struct. Make all drivers register themself. The old list of audio_driver struct pointers is now a list of audio driver names, specifying the priority (aka probe order) in case no driver is explicitly asked for. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180306074053.22856-2-kraxel@redhat.com
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r--audio/ossaudio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index a0428881c2..6c69622b4c 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -922,7 +922,7 @@ static struct audio_pcm_ops oss_pcm_ops = {
.ctl_in = oss_ctl_in
};
-struct audio_driver oss_audio_driver = {
+static struct audio_driver oss_audio_driver = {
.name = "oss",
.descr = "OSS http://www.opensound.com",
.options = oss_options,
@@ -935,3 +935,9 @@ struct audio_driver oss_audio_driver = {
.voice_size_out = sizeof (OSSVoiceOut),
.voice_size_in = sizeof (OSSVoiceIn)
};
+
+static void register_audio_oss(void)
+{
+ audio_driver_register(&oss_audio_driver);
+}
+type_init(register_audio_oss);