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
f48fde01
Commit
f48fde01
authored
May 27, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: destroy audio-device at exit (refs #6874)
(cherry picked from commit
3b0b4fb3
)
parent
8c341e8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
modules/audio_output/alsa.c
modules/audio_output/alsa.c
+18
-16
No files found.
modules/audio_output/alsa.c
View file @
f48fde01
...
...
@@ -148,10 +148,6 @@ static void DumpDeviceStatus (vlc_object_t *obj, snd_pcm_t *pcm)
*/
static
void
Probe
(
vlc_object_t
*
obj
,
const
char
*
dev
)
{
/* Due to design bug in audio output core, this hack is required: */
if
(
var_Type
(
obj
,
"audio-device"
)
==
0
)
{
/* The variable does not exist - first call. */
vlc_value_t
text
;
var_Create
(
obj
,
"audio-device"
,
VLC_VAR_STRING
|
VLC_VAR_HASCHOICE
);
...
...
@@ -159,7 +155,7 @@ static void Probe (vlc_object_t *obj, const char *dev)
var_Change
(
obj
,
"audio-device"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
GetDevices
(
obj
,
NULL
,
dev
);
}
var_AddCallback
(
obj
,
"audio-device"
,
aout_ChannelsRestart
,
NULL
);
var_TriggerCallback
(
obj
,
"intf-change"
);
}
...
...
@@ -176,12 +172,7 @@ static int Open (vlc_object_t *obj)
audio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
/* Get device name */
char
*
device
;
if
(
var_Type
(
aout
,
"audio-device"
))
device
=
var_GetString
(
aout
,
"audio-device"
);
else
device
=
var_InheritString
(
aout
,
"alsa-audio-device"
);
char
*
device
=
var_InheritString
(
aout
,
"alsa-audio-device"
);
if
(
unlikely
(
device
==
NULL
))
return
VLC_ENOMEM
;
...
...
@@ -663,7 +654,18 @@ static void Close (vlc_object_t *obj)
aout_sys_t
*
sys
=
aout
->
sys
;
snd_pcm_t
*
pcm
=
aout
->
sys
->
pcm
;
/* FIXME: ugly hack so selected ALSA device survives restart */
char
*
device
=
var_InheritString
(
obj
,
"audio-device"
);
if
(
device
!=
NULL
)
{
if
(
!
var_Type
(
obj
,
"alsa-audio-device"
))
var_Create
(
obj
,
"alsa-audio-device"
,
VLC_VAR_STRING
);
var_SetString
(
obj
,
"alsa-audio-device"
,
device
);
free
(
device
);
}
var_DelCallback
(
obj
,
"audio-device"
,
aout_ChannelsRestart
,
NULL
);
var_Destroy
(
obj
,
"audio-device"
);
snd_pcm_drop
(
pcm
);
snd_pcm_close
(
pcm
);
free
(
sys
);
...
...
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