From: Takashi Iwai Date: Tue, 27 Aug 2002 16:30:59 +0000 (+0000) Subject: output error message instead of assert(). X-Git-Tag: android-x86-9.0-r1~2447 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5191bbcce59d89ac500c20dc9227a77fbdd1595d;p=android-x86%2Fexternal-alsa-lib.git output error message instead of assert(). assert() may cause an infinite loop in aplay, since it's in the closing phase. --- diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 1553af76..efed6609 100644 --- a/src/pcm/pcm_plug.c +++ b/src/pcm/pcm_plug.c @@ -65,7 +65,10 @@ static int snd_pcm_plug_close(snd_pcm_t *pcm) int err, result = 0; if (plug->ttable) free(plug->ttable); - assert(plug->slave == plug->req_slave); + if (plug->slave != plug->req_slave) { + SNDERR("plug slaves mismatch"); + return -EINVAL; + } if (plug->close_slave) { err = snd_pcm_close(plug->req_slave); if (err < 0)