diff options
author | Kővágó, Zoltán <dirty.ice.hu@gmail.com> | 2019-03-08 23:34:13 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-11 10:29:26 +0100 |
commit | 85bc58520c0e43660cbbe51b9eb5022a0baafe9f (patch) | |
tree | 6a6e20f651bcb5ae047e90ed823d2dcaa10e06e1 /audio/wavaudio.c | |
parent | 8c3a7d008794305b1304549f1d9249c12cbf5b2b (diff) |
audio: use qapi AudioFormat instead of audfmt_e
I had to include an enum for audio sampling formats into qapi, but that
meant duplicating the audfmt_e enum. This patch replaces audfmt_e and
associated values with the qapi generated AudioFormat enum.
This patch is mostly a search-and-replace, except for switches where the
qapi generated AUDIO_FORMAT_MAX caused problems.
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 01251b2758a1679c66842120b77c0fb46d7d0eaf.1552083282.git.DirtY.iCE.hu@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/wavaudio.c')
-rw-r--r-- | audio/wavaudio.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 40adfa30c3..35a614785e 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -117,20 +117,23 @@ static int wav_init_out(HWVoiceOut *hw, struct audsettings *as, stereo = wav_as.nchannels == 2; switch (wav_as.fmt) { - case AUD_FMT_S8: - case AUD_FMT_U8: + case AUDIO_FORMAT_S8: + case AUDIO_FORMAT_U8: bits16 = 0; break; - case AUD_FMT_S16: - case AUD_FMT_U16: + case AUDIO_FORMAT_S16: + case AUDIO_FORMAT_U16: bits16 = 1; break; - case AUD_FMT_S32: - case AUD_FMT_U32: + case AUDIO_FORMAT_S32: + case AUDIO_FORMAT_U32: dolog ("WAVE files can not handle 32bit formats\n"); return -1; + + default: + abort(); } hdr[34] = bits16 ? 0x10 : 0x08; @@ -225,7 +228,7 @@ static int wav_ctl_out (HWVoiceOut *hw, int cmd, ...) static WAVConf glob_conf = { .settings.freq = 44100, .settings.nchannels = 2, - .settings.fmt = AUD_FMT_S16, + .settings.fmt = AUDIO_FORMAT_S16, .wav_path = "qemu.wav" }; |