[PATCH] pcm_hw: Respect LIBASOUND_THREAD_SAFE env var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this patch, there no way to revert to the old
behaviour with pcm_hw, so currently there will always
be some extra locking.

This seems to be an oversight?

Reported-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Signed-off-by: David Henningsson <diwic@xxxxxxxxxx>
---
 src/pcm/pcm_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 3a5634c..e6a8a4f 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1514,7 +1514,8 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
 	pcm->poll_events = info.stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
 	pcm->tstamp_type = tstamp_type;
 #ifdef THREAD_SAFE_API
-	pcm->thread_safe = 1;
+	if (pcm->thread_safe != -1)
+		pcm->thread_safe = 1;
 #endif
 
 	ret = snd_pcm_hw_mmap_status(pcm);
-- 
1.9.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux