Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
28789103
Commit
28789103
authored
Apr 14, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSS: adapt to hotplug event
parent
10605093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
24 deletions
+12
-24
modules/audio_output/oss.c
modules/audio_output/oss.c
+12
-24
No files found.
modules/audio_output/oss.c
View file @
28789103
...
...
@@ -356,32 +356,24 @@ static int MuteSet (audio_output_t *aout, bool mute)
return
0
;
}
static
int
DevicesEnum
(
audio_output_t
*
aout
,
char
***
idp
,
char
***
namep
)
static
int
DevicesEnum
(
audio_output_t
*
aout
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
int
fd
=
sys
->
fd
;
oss_sysinfo
si
;
int
fd
=
vlc_open
(
"/dev/dsp"
,
O_WRONLY
);
if
(
fd
==
-
1
)
{
fd
=
vlc_open
(
"/dev/dsp"
,
O_WRONLY
);
if
(
fd
==
-
1
)
return
-
1
;
}
return
-
1
;
oss_sysinfo
si
;
int
n
=
-
1
;
if
(
ioctl
(
fd
,
SNDCTL_SYSINFO
,
&
si
)
<
0
)
{
msg_Err
(
aout
,
"cannot get system infos: %m"
);
return
-
1
;
goto
out
;
}
msg_Dbg
(
aout
,
"using %s version %s (0x%06X) under %s"
,
si
.
product
,
si
.
version
,
si
.
versionnum
,
si
.
license
);
char
**
ids
=
xmalloc
(
sizeof
(
*
ids
)
*
si
.
numaudios
);
char
**
names
=
xmalloc
(
sizeof
(
*
names
)
*
si
.
numaudios
);
int
n
=
0
;
for
(
int
i
=
0
;
i
<
si
.
numaudios
;
i
++
)
{
oss_audioinfo
ai
=
{
.
dev
=
i
};
...
...
@@ -398,16 +390,11 @@ static int DevicesEnum (audio_output_t *aout, char ***idp, char ***namep)
if
(
!
ai
.
enabled
)
continue
;
ids
[
n
]
=
xstrdup
(
ai
.
devnode
);
names
[
n
]
=
xstrdup
(
ai
.
name
);
aout_HotplugReport
(
aout
,
ai
.
devnode
,
ai
.
name
);
n
++
;
}
*
idp
=
ids
;
*
namep
=
names
;
if
(
sys
->
fd
==
-
1
)
close
(
fd
);
out:
close
(
fd
);
return
n
;
}
...
...
@@ -449,8 +436,9 @@ static int Open (vlc_object_t *obj)
aout
->
stop
=
Stop
;
aout
->
volume_set
=
VolumeSet
;
aout
->
mute_set
=
MuteSet
;
aout
->
device_enum
=
DevicesEnum
;
aout
->
device_select
=
DeviceSelect
;
DevicesEnum
(
aout
);
return
VLC_SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment