Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
f05705c5
Commit
f05705c5
authored
Jul 27, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/audio_output/alsa.c: bail out if the device is already in use.
parent
ee88f5fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+21
-5
No files found.
modules/audio_output/alsa.c
View file @
f05705c5
...
...
@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.3
1 2003/07/18 20:06:0
0 gbazin Exp $
* $Id: alsa.c,v 1.3
2 2003/07/27 16:14:2
0 gbazin Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
...
...
@@ -111,14 +111,20 @@ static void Probe( aout_instance_t * p_aout,
{
struct
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
vlc_value_t
val
,
text
;
int
i_ret
;
var_Create
(
p_aout
,
"audio-device"
,
VLC_VAR_INTEGER
|
VLC_VAR_HASCHOICE
);
text
.
psz_string
=
_
(
"Audio device"
);
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
/* We'll open the audio device in non blocking mode so we can just exit
* when it is already in use, but for the real stuff we'll still use
* the blocking mode */
/* Now test linear PCM capabilities */
if
(
!
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_device
,
SND_PCM_STREAM_PLAYBACK
,
0
)
)
if
(
!
(
i_ret
=
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_device
,
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
)
)
)
{
int
i_channels
;
snd_pcm_hw_params_t
*
p_hw
;
...
...
@@ -196,13 +202,18 @@ static void Probe( aout_instance_t * p_aout,
/* Close the previously opened device */
snd_pcm_close
(
p_sys
->
p_snd_pcm
);
}
else
if
(
i_ret
==
-
EBUSY
)
{
msg_Warn
(
p_aout
,
"audio device: %s is already in use"
,
psz_device
);
}
/* Test for S/PDIF device if needed */
if
(
psz_iec_device
)
{
/* Opening the device should be enough */
if
(
!
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_iec_device
,
SND_PCM_STREAM_PLAYBACK
,
0
)
)
if
(
!
(
i_ret
=
snd_pcm_open
(
&
p_sys
->
p_snd_pcm
,
psz_iec_device
,
SND_PCM_STREAM_PLAYBACK
,
SND_PCM_NONBLOCK
)
)
)
{
val
.
i_int
=
AOUT_VAR_SPDIF
;
text
.
psz_string
=
N_
(
"A/52 over S/PDIF"
);
...
...
@@ -213,6 +224,11 @@ static void Probe( aout_instance_t * p_aout,
snd_pcm_close
(
p_sys
->
p_snd_pcm
);
}
else
if
(
i_ret
==
-
EBUSY
)
{
msg_Warn
(
p_aout
,
"audio device: %s is already in use"
,
psz_iec_device
);
}
}
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_CHOICESCOUNT
,
&
val
,
NULL
);
...
...
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