From: David Henningsson Date: Wed, 1 Jan 2014 12:17:38 +0000 (+0100) Subject: a52: Propagate errors from hw X-Git-Tag: v1.0.28~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=9123179acde7f475c1ed1297aac727230e9d5bf5;p=alsa-plugins.git a52: Propagate errors from hw Several callbacks returned 0 even though the hw was failing, leading applications to believe everything was fine when it wasn't. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 7188809..359608f 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -195,8 +195,8 @@ static int a52_drain(snd_pcm_ioplug_t *io) err = write_out_pending(io, rec); if (err < 0) return err; - snd_pcm_drain(rec->slave); - return 0; + + return snd_pcm_drain(rec->slave); } /* check whether the areas consist of a continuous interleaved stream */ @@ -479,16 +479,14 @@ static int a52_start(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; - snd_pcm_start(rec->slave); - return 0; + return snd_pcm_start(rec->slave); } static int a52_stop(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; - snd_pcm_drop(rec->slave); - return 0; + return snd_pcm_drop(rec->slave); } /* release resources */ @@ -645,7 +643,7 @@ static int a52_close(snd_pcm_ioplug_t *io) a52_free(rec); if (rec->slave) - snd_pcm_close(rec->slave); + return snd_pcm_close(rec->slave); return 0; }