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
b00308eb
Commit
b00308eb
authored
Apr 13, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: remove hack. Do not fail 10 times to open the same device.
parent
67673fdc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
35 deletions
+11
-35
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+11
-35
No files found.
modules/audio_output/alsa.c
View file @
b00308eb
...
...
@@ -435,42 +435,19 @@ static int Open( vlc_object_t *p_this )
/* Open the device */
msg_Dbg
(
p_aout
,
"opening ALSA device `%s'"
,
psz_device
);
for
(
unsigned
i
=
10
;
i
;
i
--
)
{
int
val
=
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_device
,
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
);
if
(
val
==
0
)
break
;
/* success! */
if
(
val
!=
-
EBUSY
)
{
msg_Err
(
p_aout
,
"cannot open ALSA device `%s' (%s)"
,
psz_device
,
snd_strerror
(
val
)
);
dialog_Fatal
(
p_aout
,
_
(
"Audio output failed"
),
_
(
"VLC could not open the ALSA device
\"
%s
\"
(%s)."
),
psz_device
,
snd_strerror
(
val
)
);
free
(
psz_device
);
free
(
p_sys
);
int
val
=
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_device
,
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
);
if
(
val
!=
0
)
{
msg_Err
(
p_aout
,
"cannot open ALSA device `%s' (%s)"
,
psz_device
,
snd_strerror
(
val
));
dialog_Fatal
(
p_aout
,
_
(
"Audio output failed"
),
_
(
"The audio device
\"
%s
\"
could not be used:
\n
%s."
),
psz_device
,
snd_strerror
(
val
));
free
(
psz_device
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
/* Since it seems snd_pcm_close hasn't really released the device at
the time it returns, probe if the device is available in loop for 1s.
We cannot use blocking mode since the we would wait indefinitely when
switching from a dmx device to surround51. */
if
(
i
==
1
)
{
msg_Err
(
p_aout
,
"audio device %s is already in use"
,
psz_device
);
dialog_Fatal
(
p_aout
,
_
(
"Audio output failed"
),
_
(
"The audio device
\"
%s
\"
is already in use."
),
psz_device
);
free
(
psz_device
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
msleep
(
CLOCK_FREQ
/
10
);
}
free
(
psz_device
);
/* We want blocking mode */
...
...
@@ -512,7 +489,6 @@ static int Open( vlc_object_t *p_this )
/* Due to some bugs in alsa with some drivers, we need to retry in s16l
if snd_pcm_hw_params fails in fl32 */
int
val
;
retry:
/* Get Initial hardware parameters */
val
=
snd_pcm_hw_params_any
(
p_sys
->
p_snd_pcm
,
p_hw
);
...
...
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