void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as)

{

    int bits = 8, sign = 0, shift = 0;



    switch (as->fmt) {

    case AUD_FMT_S8:

        sign = 1;

    case AUD_FMT_U8:

        break;



    case AUD_FMT_S16:

        sign = 1;

    case AUD_FMT_U16:

        bits = 16;

        shift = 1;

        break;



    case AUD_FMT_S32:

        sign = 1;

    case AUD_FMT_U32:

        bits = 32;

        shift = 2;

        break;

    }



    info->freq = as->freq;

    info->bits = bits;

    info->sign = sign;

    info->nchannels = as->nchannels;

    info->shift = (as->nchannels == 2) + shift;

    info->align = (1 << info->shift) - 1;

    info->bytes_per_second = info->freq << info->shift;

    info->swap_endianness = (as->endianness != AUDIO_HOST_ENDIANNESS);

}

void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as)

{

    int bits = 8, sign = 0, shift = 0;



    switch (as->fmt) {

    case AUD_FMT_S8:

        sign = 1;

    case AUD_FMT_U8:

        break;



    case AUD_FMT_S16:

        sign = 1;

    case AUD_FMT_U16:

        bits = 16;

        shift = 1;

        break;



    case AUD_FMT_S32:

        sign = 1;

    case AUD_FMT_U32:

        bits = 32;

        shift = 2;

        break;

    }



    info->freq = as->freq;

    info->bits = bits;

    info->sign = sign;

    info->nchannels = as->nchannels;

    info->shift = (as->nchannels == 2) + shift;

    info->align = (1 << info->shift) - 1;

    info->bytes_per_second = info->freq << info->shift;

    info->swap_endianness = (as->endianness != AUDIO_HOST_ENDIANNESS);

}

void FUNC_0 (struct audio_pcm_info *VAR_0, audsettings_t *VAR_1)

{

    int VAR_2 = 8, VAR_3 = 0, VAR_4 = 0;



    switch (VAR_1->fmt) {

    case AUD_FMT_S8:

        VAR_3 = 1;

    case AUD_FMT_U8:

        break;



    case AUD_FMT_S16:

        VAR_3 = 1;

    case AUD_FMT_U16:

        VAR_2 = 16;

        VAR_4 = 1;

        break;



    case AUD_FMT_S32:

        VAR_3 = 1;

    case AUD_FMT_U32:

        VAR_2 = 32;

        VAR_4 = 2;

        break;

    }



    VAR_0->freq = VAR_1->freq;

    VAR_0->VAR_2 = VAR_2;

    VAR_0->VAR_3 = VAR_3;

    VAR_0->nchannels = VAR_1->nchannels;

    VAR_0->VAR_4 = (VAR_1->nchannels == 2) + VAR_4;

    VAR_0->align = (1 << VAR_0->VAR_4) - 1;

    VAR_0->bytes_per_second = VAR_0->freq << VAR_0->VAR_4;

    VAR_0->swap_endianness = (VAR_1->endianness != AUDIO_HOST_ENDIANNESS);

}

void FUNC_0 (struct audio_pcm_info *VAR_0, audsettings_t *VAR_1)
{ int VAR_2 = 8, VAR_3 = 0, VAR_4 = 0; switch (VAR_1->fmt) { case AUD_FMT_S8:
VAR_3 = 1; case AUD_FMT_U8:
break; case AUD_FMT_S16:
VAR_3 = 1; case AUD_FMT_U16:
VAR_2 = 16; VAR_4 = 1; break; case AUD_FMT_S32:
VAR_3 = 1; case AUD_FMT_U32:
VAR_2 = 32; VAR_4 = 2; break; } VAR_0->freq = VAR_1->freq; VAR_0->VAR_2 = VAR_2; VAR_0->VAR_3 = VAR_3; VAR_0->nchannels = VAR_1->nchannels; VAR_0->VAR_4 = (VAR_1->nchannels == 2) + VAR_4; VAR_0->align = (1 << VAR_0->VAR_4) - 1; VAR_0->bytes_per_second = VAR_0->freq << VAR_0->VAR_4; VAR_0->swap_endianness = (VAR_1->endianness != AUDIO_HOST_ENDIANNESS); }