Skip to content

Commit

Permalink
ossaudio: check for oss support in oss_audio_init
Browse files Browse the repository at this point in the history
Check whenever the device path (/dev/dsp by default) exists and qemu is
allowed to access it.  Return NULL if it isn't, so ossaudio will not
be used on systems wihtout oss support (increasinly common on modern
linux systems).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed Nov 7, 2013
1 parent 926de75 commit 73204cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions audio/ossaudio.c
Expand Up @@ -849,6 +849,10 @@ static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...)

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;
}

Expand Down

0 comments on commit 73204cf

Please sign in to comment.