qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] ossaudio: do not enable by default


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH] ossaudio: do not enable by default
Date: Wed, 06 Nov 2013 16:20:55 +0100

  Hi,

> > static void *oss_audio_init (void)
> > {
> >     return &conf;
> > }
> >
> > It never fails.
> 
> OK, that's a bug. (I'd misread the calling function
> audio_driver_init() as also checking that the init_in
> and init_out functions succeeded, which it does not.)
>
> > So audio is broken on Linux by default today.  This
> > patch unbreaks it.
> 
> No, this patch is papering over the problem by giving us
> a default config where audio works for nobody.
> 
> If you want to fix that problem you need to do it by
> making the oss_audio_init() function return failure
> on init.

And that is actually simple enough that we can consider it for 1.7:

 static void *oss_audio_init (void)
 {
+    if (access(conf.devpath_in, R_OK | W_OK) < 0 ||
+        access(conf.devpath_out, R_OK | W_OK) < 0) {
+        return NULL;
+    }
     return &conf;
 }

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]