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
ade985f6
Commit
ade985f6
authored
Jan 14, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: report errors when, and simplify enumerating devices
parent
c255d973
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
28 deletions
+15
-28
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+15
-28
No files found.
modules/audio_output/alsa.c
View file @
ade985f6
...
...
@@ -908,8 +908,8 @@ error:
msleep
(
p_sys
->
i_period_time
/
2
);
}
static
void
GetDevicesForCard
(
module_config_t
*
p_item
,
int
i_
card
);
static
void
GetDevices
(
module_config_t
*
p_item
);
static
void
GetDevicesForCard
(
vlc_object_t
*
,
module_config_t
*
,
int
card
);
static
void
GetDevices
(
vlc_object_t
*
,
module_config_t
*
);
/*****************************************************************************
* config variable callback
...
...
@@ -918,7 +918,6 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
vlc_value_t
newval
,
vlc_value_t
oldval
,
void
*
p_unused
)
{
module_config_t
*
p_item
;
int
i
;
(
void
)
newval
;
(
void
)
oldval
;
(
void
)
p_unused
;
...
...
@@ -929,6 +928,8 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
/* Clear-up the current list */
if
(
p_item
->
i_list
)
{
int
i
;
/* Keep the first entrie */
for
(
i
=
1
;
i
<
p_item
->
i_list
;
i
++
)
{
...
...
@@ -941,7 +942,7 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
}
p_item
->
i_list
=
1
;
GetDevices
(
p_item
);
GetDevices
(
p_
this
,
p_
item
);
/* Signal change to the interface */
p_item
->
b_dirty
=
true
;
...
...
@@ -950,7 +951,8 @@ static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
}
static
void
GetDevicesForCard
(
module_config_t
*
p_item
,
int
i_card
)
static
void
GetDevicesForCard
(
vlc_object_t
*
obj
,
module_config_t
*
p_item
,
int
i_card
)
{
int
i_pcm_device
=
-
1
;
int
i_err
=
0
;
...
...
@@ -984,12 +986,8 @@ static void GetDevicesForCard( module_config_t *p_item, int i_card )
if
(
(
i_err
=
snd_ctl_pcm_info
(
p_ctl
,
p_pcm_info
)
)
<
0
)
{
if
(
i_err
!=
-
ENOENT
)
{
/*printf( "get_devices_for_card(): "
"snd_ctl_pcm_info() "
"failed (%d:%d): %s.\n", i_card,
i_pcm_device, snd_strerror( -i_err ) );*/
}
msg_Err
(
obj
,
"cannot get PCM device %d:%d infos: %s"
,
i_card
,
i_pcm_device
,
snd_strerror
(
-
i_err
)
);
continue
;
}
...
...
@@ -1017,25 +1015,14 @@ static void GetDevicesForCard( module_config_t *p_item, int i_card )
}
static
void
GetDevices
(
module_config_t
*
p_item
)
static
void
GetDevices
(
vlc_object_t
*
obj
,
module_config_t
*
p_item
)
{
int
i_card
=
-
1
;
int
i_err
=
0
;
int
i_err
;
if
(
(
i_err
=
snd_card_next
(
&
i_card
)
)
!=
0
)
{
/*printf( "snd_card_next() failed: %s", snd_strerror( -i_err ) );*/
return
;
}
while
(
(
i_err
=
snd_card_next
(
&
i_card
))
==
0
&&
i_card
>
-
1
)
GetDevicesForCard
(
obj
,
p_item
,
i_card
);
while
(
i_card
>
-
1
)
{
GetDevicesForCard
(
p_item
,
i_card
);
if
(
(
i_err
=
snd_card_next
(
&
i_card
)
)
!=
0
)
{
/*printf( "snd_card_next() failed: %s", snd_strerror( -i_err ) );*/
break
;
}
}
if
(
i_err
)
msg_Err
(
obj
,
"cannot enumerate cards: %s"
,
snd_strerror
(
-
i_err
)
);
}
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