mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
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>
This commit is contained in:
parent
8c3a7d0087
commit
85bc58520c
26 changed files with 196 additions and 189 deletions
|
@ -66,7 +66,7 @@ typedef struct SB16State {
|
|||
int fmt_stereo;
|
||||
int fmt_signed;
|
||||
int fmt_bits;
|
||||
audfmt_e fmt;
|
||||
AudioFormat fmt;
|
||||
int dma_auto;
|
||||
int block_size;
|
||||
int fifo;
|
||||
|
@ -224,7 +224,7 @@ static void continue_dma8 (SB16State *s)
|
|||
|
||||
static void dma_cmd8 (SB16State *s, int mask, int dma_len)
|
||||
{
|
||||
s->fmt = AUD_FMT_U8;
|
||||
s->fmt = AUDIO_FORMAT_U8;
|
||||
s->use_hdma = 0;
|
||||
s->fmt_bits = 8;
|
||||
s->fmt_signed = 0;
|
||||
|
@ -319,18 +319,18 @@ static void dma_cmd (SB16State *s, uint8_t cmd, uint8_t d0, int dma_len)
|
|||
|
||||
if (16 == s->fmt_bits) {
|
||||
if (s->fmt_signed) {
|
||||
s->fmt = AUD_FMT_S16;
|
||||
s->fmt = AUDIO_FORMAT_S16;
|
||||
}
|
||||
else {
|
||||
s->fmt = AUD_FMT_U16;
|
||||
s->fmt = AUDIO_FORMAT_U16;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (s->fmt_signed) {
|
||||
s->fmt = AUD_FMT_S8;
|
||||
s->fmt = AUDIO_FORMAT_S8;
|
||||
}
|
||||
else {
|
||||
s->fmt = AUD_FMT_U8;
|
||||
s->fmt = AUDIO_FORMAT_U8;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -852,7 +852,7 @@ static void legacy_reset (SB16State *s)
|
|||
|
||||
as.freq = s->freq;
|
||||
as.nchannels = 1;
|
||||
as.fmt = AUD_FMT_U8;
|
||||
as.fmt = AUDIO_FORMAT_U8;
|
||||
as.endianness = 0;
|
||||
|
||||
s->voice = AUD_open_out (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue