Using assert() for non-fatal error checks is really brain-dead.
These are especially bad, as it hits even in the normal operation with
plugins and some h/w constraints.
Reported-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
snd_pcm_hw_params_t slave_params;
int err;
err = sprepare(pcm, &slave_params);
- assert(err >= 0);
+ if (err < 0)
+ return err;
err = schange(pcm, params, &slave_params);
- assert(err >= 0);
+ if (err < 0)
+ return err;
err = sparams(pcm, &slave_params);
if (err < 0)
cchange(pcm, params, &slave_params);