diff options
author | malc <av1474@comtv.ru> | 2010-04-21 15:40:23 +0400 |
---|---|---|
committer | malc <av1474@comtv.ru> | 2010-04-21 15:40:23 +0400 |
commit | 0475f4a5d2a3c47fbb41a86d90342101a2806c0e (patch) | |
tree | 2b5343d1aeb03d7af96da616964d7ba0332d8b93 | |
parent | a9fb5a74da98c395a4e5f1b9d2e4fd8dee1fece4 (diff) | |
download | qemu-0475f4a5d2a3c47fbb41a86d90342101a2806c0e.tar.gz qemu-0475f4a5d2a3c47fbb41a86d90342101a2806c0e.tar.bz2 qemu-0475f4a5d2a3c47fbb41a86d90342101a2806c0e.zip |
audio/alsa: Avoid snd_pcm_format_t vs audfmt_e mixup
Spotted by Serge Ziryukin and based on his patch, thanks.
Signed-off-by: malc <av1474@comtv.ru>
-rw-r--r-- | audio/alsaaudio.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 88344ff03b..f0171f9842 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -411,10 +411,11 @@ static int alsa_to_audfmt (snd_pcm_format_t alsafmt, audfmt_e *fmt, } static void alsa_dump_info (struct alsa_params_req *req, - struct alsa_params_obt *obt) + struct alsa_params_obt *obt, + snd_pcm_format_t obtfmt) { dolog ("parameter | requested value | obtained value\n"); - dolog ("format | %10d | %10d\n", req->fmt, obt->fmt); + dolog ("format | %10d | %10d\n", req->fmt, obtfmt); dolog ("channels | %10d | %10d\n", req->nchannels, obt->nchannels); dolog ("frequency | %10d | %10d\n", req->freq, obt->freq); @@ -666,15 +667,15 @@ static int alsa_open (int in, struct alsa_params_req *req, *handlep = handle; if (conf.verbose && - (obt->fmt != req->fmt || + (obtfmt != req->fmt || obt->nchannels != req->nchannels || obt->freq != req->freq)) { dolog ("Audio parameters for %s\n", typ); - alsa_dump_info (req, obt); + alsa_dump_info (req, obt, obtfmt); } #ifdef DEBUG - alsa_dump_info (req, obt); + alsa_dump_info (req, obt, obtfmt); #endif return 0; |