]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
a52: Propagate errors from hw
authorDavid Henningsson <david.henningsson@canonical.com>
Wed, 1 Jan 2014 12:17:38 +0000 (13:17 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2014 10:40:07 +0000 (11:40 +0100)
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 <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
a52/pcm_a52.c

index 7188809bc7bffdbdb90e92cee093be5e756b84fd..359608fbafe31b4fccfddee097becc0a1b09add2 100644 (file)
@@ -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;
 }