Patchwork audio/alsa: fix comparison between requested and obtained formats

login
register
mail settings
Submitter Serge Ziryukin
Date April 21, 2010, 8:20 a.m.
Message ID <20100421082010.GA22649@ftrvxmtrx>
Download mbox | patch
Permalink /patch/50714/
State New
Headers show

Comments

Serge Ziryukin - April 21, 2010, 8:20 a.m.
Trivial patch which uses aud_to_alsafmt to fix comparison
between alsa and internal audio pcm format enum.
---
 audio/alsaaudio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Aurelien Jarno - May 18, 2010, 6:40 p.m.
On Wed, Apr 21, 2010 at 11:20:10AM +0300, Serge Ziryukin wrote:
> Trivial patch which uses aud_to_alsafmt to fix comparison
> between alsa and internal audio pcm format enum.
> ---
>  audio/alsaaudio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Aurelien Jarno <aurelien@aurel32.net>

> diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
> index 88344ff..d784476 100644
> --- a/audio/alsaaudio.c
> +++ b/audio/alsaaudio.c
> @@ -666,7 +666,7 @@ static int alsa_open (int in, struct alsa_params_req *req,
>      *handlep = handle;
>  
>      if (conf.verbose &&
> -        (obt->fmt != req->fmt ||
> +        (aud_to_alsafmt(obt->fmt) != req->fmt ||
>           obt->nchannels != req->nchannels ||
>           obt->freq != req->freq)) {
>          dolog ("Audio parameters for %s\n", typ);
> -- 
> 1.7.0.5
>

Patch

diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 88344ff..d784476 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -666,7 +666,7 @@  static int alsa_open (int in, struct alsa_params_req *req,
     *handlep = handle;
 
     if (conf.verbose &&
-        (obt->fmt != req->fmt ||
+        (aud_to_alsafmt(obt->fmt) != req->fmt ||
          obt->nchannels != req->nchannels ||
          obt->freq != req->freq)) {
         dolog ("Audio parameters for %s\n", typ);