aboutsummaryrefslogtreecommitdiff
path: root/hw/audio/hda-codec.c
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-03-08 23:34:13 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-11 10:29:26 +0100
commit85bc58520c0e43660cbbe51b9eb5022a0baafe9f (patch)
tree6a6e20f651bcb5ae047e90ed823d2dcaa10e06e1 /hw/audio/hda-codec.c
parent8c3a7d008794305b1304549f1d9249c12cbf5b2b (diff)
downloadqemu-85bc58520c0e43660cbbe51b9eb5022a0baafe9f.zip
qemu-85bc58520c0e43660cbbe51b9eb5022a0baafe9f.tar.gz
qemu-85bc58520c0e43660cbbe51b9eb5022a0baafe9f.tar.bz2
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 'hw/audio/hda-codec.c')
-rw-r--r--hw/audio/hda-codec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index 617a1c1..c25bfa3 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -99,9 +99,9 @@ static void hda_codec_parse_fmt(uint32_t format, struct audsettings *as)
}
switch (format & AC_FMT_BITS_MASK) {
- case AC_FMT_BITS_8: as->fmt = AUD_FMT_S8; break;
- case AC_FMT_BITS_16: as->fmt = AUD_FMT_S16; break;
- case AC_FMT_BITS_32: as->fmt = AUD_FMT_S32; break;
+ case AC_FMT_BITS_8: as->fmt = AUDIO_FORMAT_S8; break;
+ case AC_FMT_BITS_16: as->fmt = AUDIO_FORMAT_S16; break;
+ case AC_FMT_BITS_32: as->fmt = AUDIO_FORMAT_S32; break;
}
as->nchannels = ((format & AC_FMT_CHAN_MASK) >> AC_FMT_CHAN_SHIFT) + 1;
@@ -134,12 +134,12 @@ static void hda_codec_parse_fmt(uint32_t format, struct audsettings *as)
/* -------------------------------------------------------------------------- */
static const char *fmt2name[] = {
- [ AUD_FMT_U8 ] = "PCM-U8",
- [ AUD_FMT_S8 ] = "PCM-S8",
- [ AUD_FMT_U16 ] = "PCM-U16",
- [ AUD_FMT_S16 ] = "PCM-S16",
- [ AUD_FMT_U32 ] = "PCM-U32",
- [ AUD_FMT_S32 ] = "PCM-S32",
+ [ AUDIO_FORMAT_U8 ] = "PCM-U8",
+ [ AUDIO_FORMAT_S8 ] = "PCM-S8",
+ [ AUDIO_FORMAT_U16 ] = "PCM-U16",
+ [ AUDIO_FORMAT_S16 ] = "PCM-S16",
+ [ AUDIO_FORMAT_U32 ] = "PCM-U32",
+ [ AUDIO_FORMAT_S32 ] = "PCM-S32",
};
typedef struct HDAAudioState HDAAudioState;