Commit b0dcc696 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

OSS: open device node to list devices if required

parent 0150650e
...@@ -363,7 +363,12 @@ static int DevicesEnum (audio_output_t *aout, char ***idp, char ***namep) ...@@ -363,7 +363,12 @@ static int DevicesEnum (audio_output_t *aout, char ***idp, char ***namep)
oss_sysinfo si; oss_sysinfo si;
if (fd == -1) if (fd == -1)
return -1; {
fd = vlc_open ("/dev/dsp", O_WRONLY);
if (fd == -1)
return -1;
}
if (ioctl (fd, SNDCTL_SYSINFO, &si) < 0) if (ioctl (fd, SNDCTL_SYSINFO, &si) < 0)
{ {
msg_Err (aout, "cannot get system infos: %m"); msg_Err (aout, "cannot get system infos: %m");
...@@ -397,8 +402,12 @@ static int DevicesEnum (audio_output_t *aout, char ***idp, char ***namep) ...@@ -397,8 +402,12 @@ static int DevicesEnum (audio_output_t *aout, char ***idp, char ***namep)
names[n] = xstrdup (ai.name); names[n] = xstrdup (ai.name);
n++; n++;
} }
*idp = ids; *idp = ids;
*namep = names; *namep = names;
if (sys->fd == -1)
close (fd);
return n; return n;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment