summaryrefslogtreecommitdiffstats
path: root/audio/alsaaudio.c
diff options
context:
space:
mode:
authorPeter Maydell2021-01-15 23:21:21 +0100
committerPeter Maydell2021-01-15 23:21:21 +0100
commit825a215c003cd028e26c7d19aa5049d957345f43 (patch)
treea3bedcc1d73490abbe5994b065289147f8d0b10e /audio/alsaaudio.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/ui-20210115-pull-request' i... (diff)
parentaudio: space prohibited between function name and parenthesis'(' (diff)
downloadqemu-825a215c003cd028e26c7d19aa5049d957345f43.tar.gz
qemu-825a215c003cd028e26c7d19aa5049d957345f43.tar.xz
qemu-825a215c003cd028e26c7d19aa5049d957345f43.zip
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20210115-pull-request' into staging
audio: improvements for sdl, pulse, fsound. audio: cleanups & codestyle fixes. # gpg: Signature made Fri 15 Jan 2021 13:20:56 GMT # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/audio-20210115-pull-request: (30 commits) audio: space prohibited between function name and parenthesis'(' audio: Suspect code indent for conditional statements audio: Don't use '%#' in format strings audio: Fix lines over 90 characters audio: foo* bar" should be "foo *bar". audio: Add spaces around operator/delete redundant spaces audio: Add braces for statements/fix braces' position dsoundaudio: fix log message dsoundaudio: enable f32 audio sample format dsoundaudio: rename dsound_open() dsoundaudio: replace GetForegroundWindow() paaudio: send recorded data in smaller chunks paaudio: limit minreq to 75% of audio timer_rate paaudio: comment bugs in functions qpa_init_* paaudio: remove unneeded code paaudio: wait until the playback stream is ready paaudio: wait for PA_STREAM_READY in qpa_write() paaudio: avoid to clip samples multiple times audio: remove remaining unused plive code sdlaudio: enable (in|out).mixing-engine=off ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'audio/alsaaudio.c')
-rw-r--r--audio/alsaaudio.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index a8e62542f9..fcc2f62864 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -278,32 +278,28 @@ static snd_pcm_format_t aud_to_alsafmt (AudioFormat fmt, int endianness)
case AUDIO_FORMAT_S16:
if (endianness) {
return SND_PCM_FORMAT_S16_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_S16_LE;
}
case AUDIO_FORMAT_U16:
if (endianness) {
return SND_PCM_FORMAT_U16_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_U16_LE;
}
case AUDIO_FORMAT_S32:
if (endianness) {
return SND_PCM_FORMAT_S32_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_S32_LE;
}
case AUDIO_FORMAT_U32:
if (endianness) {
return SND_PCM_FORMAT_U32_BE;
- }
- else {
+ } else {
return SND_PCM_FORMAT_U32_LE;
}
@@ -599,7 +595,7 @@ static int alsa_open(bool in, struct alsa_params_req *req,
}
#ifdef DEBUG
- alsa_dump_info(req, obt, obtfmt, pdo);
+ alsa_dump_info(req, obt, obtfmt, apdo);
#endif
return 0;
@@ -722,8 +718,7 @@ static int alsa_voice_ctl (snd_pcm_t *handle, const char *typ, int ctl)
alsa_logerr (err, "Could not stop %s\n", typ);
return -1;
}
- }
- else {
+ } else {
err = snd_pcm_prepare (handle);
if (err < 0) {
alsa_logerr (err, "Could not prepare handle for %s\n", typ);
@@ -929,6 +924,7 @@ static struct audio_pcm_ops alsa_pcm_ops = {
.init_in = alsa_init_in,
.fini_in = alsa_fini_in,
.read = alsa_read,
+ .run_buffer_in = audio_generic_run_buffer_in,
.enable_in = alsa_enable_in,
};