summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-27 09:37:54 +0100
committerTakashi Iwai <tiwai@suse.de>2013-11-27 09:37:54 +0100
commit49ad6699e68862ef9888bdf10b5bdaa19933f1ea (patch)
tree11399c0b3c63053470036e2c28ff209d4eba65ca
parent29d89ba0452e29830ca6cd34636aecf160a94a9d (diff)
downloadalsa-lib-49ad6699e68862ef9888bdf10b5bdaa19933f1ea.tar.gz
dmix: Don't use assert() and abort()
We seem to still have some races at closing a dmix stream, but aborting is the worst option. Let's make not melt down. Reference: https://bugzilla.novell.com/show_bug.cgi?id=852446 Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/pcm/pcm_direct.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 70c2c6a0..5ae39c0e 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -274,8 +274,8 @@ static inline int snd_pcm_direct_semaphore_up(snd_pcm_direct_t *dmix, int sem_nu
static inline int snd_pcm_direct_semaphore_final(snd_pcm_direct_t *dmix, int sem_num)
{
if (dmix->locked[sem_num] != 1) {
- assert(dmix->locked[sem_num] != 1);
- abort();
+ SNDMSG("invalid semaphore count to finalize %d: %d", sem_num, dmix->locked[sem_num]);
+ return -EBUSY;
}
return snd_pcm_direct_semaphore_up(dmix, sem_num);
}