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
10a1ac82
Commit
10a1ac82
authored
Jun 02, 2011
by
Colin Guthrie
Committed by
Rémi Denis-Courmont
Jul 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: Properly cork/uncork streams on pause/resume.
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
a4d304c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+21
-2
No files found.
modules/audio_output/pulse.c
View file @
10a1ac82
...
@@ -252,7 +252,7 @@ static void Play(aout_instance_t *aout)
...
@@ -252,7 +252,7 @@ static void Play(aout_instance_t *aout)
* will take place, and sooner or later a deadlock. */
* will take place, and sooner or later a deadlock. */
pa_threaded_mainloop_lock
(
sys
->
mainloop
);
pa_threaded_mainloop_lock
(
sys
->
mainloop
);
if
(
pa_stream_is_corked
(
s
ys
->
stream
)
>
0
)
{
if
(
pa_stream_is_corked
(
s
)
>
0
)
{
pa_operation
*
op
=
pa_stream_cork
(
s
,
0
,
NULL
,
NULL
);
pa_operation
*
op
=
pa_stream_cork
(
s
,
0
,
NULL
,
NULL
);
if
(
op
!=
NULL
)
if
(
op
!=
NULL
)
pa_operation_unref
(
op
);
pa_operation_unref
(
op
);
...
@@ -316,6 +316,25 @@ static void Play(aout_instance_t *aout)
...
@@ -316,6 +316,25 @@ static void Play(aout_instance_t *aout)
pa_threaded_mainloop_unlock
(
sys
->
mainloop
);
pa_threaded_mainloop_unlock
(
sys
->
mainloop
);
}
}
static
void
Pause
(
aout_instance_t
*
aout
,
bool
b_paused
,
mtime_t
i_date
)
{
aout_sys_t
*
sys
=
aout
->
output
.
p_sys
;
pa_stream
*
s
=
sys
->
stream
;
/* Note: The core already holds the output FIFO lock at this point.
* Therefore we must not under any circumstances (try to) acquire the
* output FIFO lock while the PulseAudio threaded main loop lock is held
* (including from PulseAudio stream callbacks). Otherwise lock inversion
* will take place, and sooner or later a deadlock. */
pa_threaded_mainloop_lock
(
sys
->
mainloop
);
pa_operation
*
op
=
pa_stream_cork
(
s
,
b_paused
?
1
:
0
,
NULL
,
NULL
);
if
(
op
!=
NULL
)
pa_operation_unref
(
op
);
pa_threaded_mainloop_unlock
(
sys
->
mainloop
);
}
static
int
VolumeSet
(
aout_instance_t
*
aout
,
audio_volume_t
vol
,
bool
mute
)
static
int
VolumeSet
(
aout_instance_t
*
aout
,
audio_volume_t
vol
,
bool
mute
)
{
{
aout_sys_t
*
sys
=
aout
->
output
.
p_sys
;
aout_sys_t
*
sys
=
aout
->
output
.
p_sys
;
...
@@ -581,7 +600,7 @@ static int Open(vlc_object_t *obj)
...
@@ -581,7 +600,7 @@ static int Open(vlc_object_t *obj)
pa_threaded_mainloop_unlock
(
mainloop
);
pa_threaded_mainloop_unlock
(
mainloop
);
aout
->
output
.
pf_play
=
Play
;
aout
->
output
.
pf_play
=
Play
;
aout
->
output
.
pf_pause
=
NULL
;
aout
->
output
.
pf_pause
=
Pause
;
aout
->
output
.
pf_volume_set
=
VolumeSet
;
aout
->
output
.
pf_volume_set
=
VolumeSet
;
return
VLC_SUCCESS
;
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