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
9ddb2cef
Commit
9ddb2cef
authored
Apr 12, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: fix locking when changing device
parent
00deb25e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+12
-9
No files found.
modules/audio_output/pulse.c
View file @
9ddb2cef
...
@@ -50,8 +50,8 @@ vlc_module_end ()
...
@@ -50,8 +50,8 @@ vlc_module_end ()
/* NOTE:
/* NOTE:
* Be careful what you do when the PulseAudio mainloop is held, which is to say
* Be careful what you do when the PulseAudio mainloop is held, which is to say
* within PulseAudio callbacks, or after pa_threaded_mainloop_lock().
* within PulseAudio callbacks, or after pa_threaded_mainloop_lock().
* In particular,
the VLC audio output object variables can be manipula
ted with
* In particular,
a VLC variable callback cannot be triggered nor dele
ted with
* the PulseAudio mainloop lock held,
but not vice versa!
*/
* the PulseAudio mainloop lock held,
if the callback acquires the lock.
*/
struct
aout_sys_t
struct
aout_sys_t
{
{
...
@@ -354,16 +354,19 @@ static int StreamMove(vlc_object_t *obj, const char *varname, vlc_value_t old,
...
@@ -354,16 +354,19 @@ static int StreamMove(vlc_object_t *obj, const char *varname, vlc_value_t old,
uint32_t
idx
=
pa_stream_get_index
(
s
);
uint32_t
idx
=
pa_stream_get_index
(
s
);
uint32_t
sink_idx
=
val
.
i_int
;
uint32_t
sink_idx
=
val
.
i_int
;
(
void
)
varname
;
(
void
)
old
;
pa_threaded_mainloop_lock
(
sys
->
mainloop
);
op
=
pa_context_move_sink_input_by_index
(
sys
->
context
,
idx
,
sink_idx
,
op
=
pa_context_move_sink_input_by_index
(
sys
->
context
,
idx
,
sink_idx
,
NULL
,
NULL
);
NULL
,
NULL
);
if
(
unlikely
(
op
==
NULL
))
{
if
(
likely
(
op
!=
NULL
))
{
pa_operation_unref
(
op
);
msg_Dbg
(
aout
,
"moving to sink %"
PRIu32
,
sink_idx
);
}
else
error
(
aout
,
"cannot move sink"
,
sys
->
context
);
error
(
aout
,
"cannot move sink"
,
sys
->
context
);
return
VLC_EGENERIC
;
pa_threaded_mainloop_unlock
(
sys
->
mainloop
);
}
pa_operation_unref
(
op
);
return
(
op
!=
NULL
)
?
VLC_SUCCESS
:
VLC_EGENERIC
;
msg_Dbg
(
aout
,
"moving to sink %"
PRIu32
,
sink_idx
);
(
void
)
varname
;
(
void
)
old
;
return
VLC_SUCCESS
;
}
}
...
...
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