diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-15 17:10:06 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-15 17:10:06 +0000 |
commit | 8f186a3535a4e833d34288e33fc2ff55c3f36024 (patch) | |
tree | e210e234aaffc09c11a66a39a89ff54b64207774 | |
parent | 65792a201f15bcfad880f29c3b52d9f90717b1ca (diff) | |
download | mpv-8f186a3535a4e833d34288e33fc2ff55c3f36024.tar.bz2 mpv-8f186a3535a4e833d34288e33fc2ff55c3f36024.tar.xz |
pa_stream_write reportedly needs locking of the main loop
(could not find official documentation on this subject...)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25414 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_pulse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c index f94be77d5b..a2440609c8 100644 --- a/libao2/ao_pulse.c +++ b/libao2/ao_pulse.c @@ -256,10 +256,12 @@ static void uninit(int immed) { /** Play the specified data to the pulseaudio server */ static int play(void* data, int len, int flags) { + pa_threaded_mainloop_lock(mainloop); if (pa_stream_write(stream, data, len, NULL, 0, PA_SEEK_RELATIVE) < 0) { GENERIC_ERR_MSG(context, "pa_stream_write() failed"); - return -1; + len = -1; } + pa_threaded_mainloop_unlock(mainloop); return len; } |