[alsa-devel] [PATCH (alsa-plugins)] a52: Propagate errors from hw

David Henningsson david.henningsson at canonical.com
Wed Jan 1 13:17:38 CET 2014


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 at canonical.com>
---
 a52/pcm_a52.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c
index 7188809..59a49ed 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;
 }
 			      
-- 
1.8.4.2



More information about the Alsa-devel mailing list