Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b3df4dc2
Commit
b3df4dc2
authored
Aug 23, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/pulse: fix deadlock when the stream was suspended
Check if the stream is suspended; wake up the main loop when it becomes suspended.
parent
3db9ab82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
NEWS
NEWS
+1
-0
pulse_output_plugin.c
src/output/pulse_output_plugin.c
+31
-0
No files found.
NEWS
View file @
b3df4dc2
...
...
@@ -14,6 +14,7 @@ ver 0.16.4 (2011/??/??)
- alsa: fix SIGFPE when alsa announces a period size of 0
- httpd: don't warn on client disconnect
- pulse: fix deadlock when resuming the stream
- pulse: fix deadlock when the stream was suspended
ver 0.16.3 (2011/06/04)
...
...
src/output/pulse_output_plugin.c
View file @
b3df4dc2
...
...
@@ -412,6 +412,23 @@ pulse_output_wait_connection(struct pulse_output *po, GError **error_r)
}
}
#if PA_CHECK_VERSION(0,9,8)
static
void
pulse_output_stream_suspended_cb
(
G_GNUC_UNUSED
pa_stream
*
stream
,
void
*
userdata
)
{
struct
pulse_output
*
po
=
userdata
;
assert
(
stream
==
po
->
stream
||
po
->
stream
==
NULL
);
assert
(
po
->
mainloop
!=
NULL
);
/* wake up the main loop to break out of the loop in
pulse_output_play() */
pa_threaded_mainloop_signal
(
po
->
mainloop
,
0
);
}
#endif
static
void
pulse_output_stream_state_cb
(
pa_stream
*
stream
,
void
*
userdata
)
{
...
...
@@ -508,6 +525,11 @@ pulse_output_open(void *data, struct audio_format *audio_format,
return
false
;
}
#if PA_CHECK_VERSION(0,9,8)
pa_stream_set_suspended_callback
(
po
->
stream
,
pulse_output_stream_suspended_cb
,
po
);
#endif
pa_stream_set_state_callback
(
po
->
stream
,
pulse_output_stream_state_cb
,
po
);
pa_stream_set_write_callback
(
po
->
stream
,
...
...
@@ -719,6 +741,15 @@ pulse_output_play(void *data, const void *chunk, size_t size, GError **error_r)
/* wait until the server allows us to write */
while
(
po
->
writable
==
0
)
{
#if PA_CHECK_VERSION(0,9,8)
if
(
pa_stream_is_suspended
(
po
->
stream
))
{
pa_threaded_mainloop_unlock
(
po
->
mainloop
);
g_set_error
(
error_r
,
pulse_output_quark
(),
0
,
"suspended"
);
return
0
;
}
#endif
pa_threaded_mainloop_wait
(
po
->
mainloop
);
if
(
pa_stream_get_state
(
po
->
stream
)
!=
PA_STREAM_READY
)
{
...
...
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