Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f094d815
Commit
f094d815
authored
Oct 05, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: list default and configured device in choice list (fix #4995)
parent
55bfdd0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+25
-0
No files found.
modules/audio_output/alsa.c
View file @
f094d815
...
...
@@ -745,6 +745,7 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
static
void
GetDevices
(
vlc_object_t
*
obj
,
module_config_t
*
item
)
{
void
**
hints
;
bool
hinted_default
=
false
;
msg_Dbg
(
obj
,
"Available ALSA PCM devices:"
);
...
...
@@ -771,6 +772,9 @@ static void GetDevices (vlc_object_t *obj, module_config_t *item)
*
lf
=
' '
;
msg_Dbg
(
obj
,
"%s (%s)"
,
(
desc
!=
NULL
)
?
desc
:
name
,
name
);
if
(
!
strcmp
(
name
,
"default"
))
hinted_default
=
true
;
if
(
item
!=
NULL
)
{
item
->
ppsz_list
=
xrealloc
(
item
->
ppsz_list
,
...
...
@@ -803,4 +807,25 @@ static void GetDevices (vlc_object_t *obj, module_config_t *item)
item
->
ppsz_list
[
item
->
i_list
]
=
NULL
;
item
->
ppsz_list_text
[
item
->
i_list
]
=
NULL
;
}
else
{
vlc_value_t
val
,
text
;
if
(
!
hinted_default
)
{
val
.
psz_string
=
(
char
*
)
"default"
;
text
.
psz_string
=
(
char
*
)
N_
(
"Default"
);
var_Change
(
obj
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
}
val
.
psz_string
=
var_InheritString
(
obj
,
"alsa-audio-device"
);
if
(
likely
(
val
.
psz_string
!=
NULL
)
&&
strcmp
(
val
.
psz_string
,
"default"
))
{
text
.
psz_string
=
(
char
*
)
N_
(
"VLC preferences"
);
var_Change
(
obj
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
}
var_Change
(
obj
,
"audio-device"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
free
(
val
.
psz_string
);
}
}
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