static int line_in_init (HWVoiceIn *hw, struct audsettings *as)

{

    SpiceVoiceIn *in = container_of (hw, SpiceVoiceIn, hw);

    struct audsettings settings;



#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    settings.freq       = spice_server_get_best_record_rate(NULL);

#else

    settings.freq       = SPICE_INTERFACE_RECORD_FREQ;

#endif

    settings.nchannels  = SPICE_INTERFACE_RECORD_CHAN;

    settings.fmt        = AUD_FMT_S16;

    settings.endianness = AUDIO_HOST_ENDIANNESS;



    audio_pcm_init_info (&hw->info, &settings);

    hw->samples = LINE_IN_SAMPLES;

    in->active = 0;



    in->sin.base.sif = &record_sif.base;

    qemu_spice_add_interface (&in->sin.base);

#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    spice_server_set_record_rate(&in->sin, settings.freq);

#endif

    return 0;

}

static int line_in_init (HWVoiceIn *hw, struct audsettings *as)

{

    SpiceVoiceIn *in = container_of (hw, SpiceVoiceIn, hw);

    struct audsettings settings;



#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    settings.freq       = spice_server_get_best_record_rate(NULL);

#else

    settings.freq       = SPICE_INTERFACE_RECORD_FREQ;

#endif

    settings.nchannels  = SPICE_INTERFACE_RECORD_CHAN;

    settings.fmt        = AUD_FMT_S16;

    settings.endianness = AUDIO_HOST_ENDIANNESS;



    audio_pcm_init_info (&hw->info, &settings);

    hw->samples = LINE_IN_SAMPLES;

    in->active = 0;



    in->sin.base.sif = &record_sif.base;

    qemu_spice_add_interface (&in->sin.base);

#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    spice_server_set_record_rate(&in->sin, settings.freq);

#endif

    return 0;

}

static int line_in_init (HWVoiceIn *hw, struct audsettings *as)
static int FUNC_0 (HWVoiceIn *VAR_0, struct audsettings *VAR_1)

{

    SpiceVoiceIn *in = container_of (VAR_0, SpiceVoiceIn, VAR_0);

    struct audsettings VAR_2;



#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    VAR_2.freq       = spice_server_get_best_record_rate(NULL);

#else

    VAR_2.freq       = SPICE_INTERFACE_RECORD_FREQ;

#endif

    VAR_2.nchannels  = SPICE_INTERFACE_RECORD_CHAN;

    VAR_2.fmt        = AUD_FMT_S16;

    VAR_2.endianness = AUDIO_HOST_ENDIANNESS;



    audio_pcm_init_info (&VAR_0->info, &VAR_2);

    VAR_0->samples = LINE_IN_SAMPLES;

    in->active = 0;



    in->sin.base.sif = &record_sif.base;

    qemu_spice_add_interface (&in->sin.base);

#if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3

    spice_server_set_record_rate(&in->sin, VAR_2.freq);

#endif

    return 0;

}

static int FUNC_0 (HWVoiceIn *VAR_0, struct audsettings *VAR_1)
{ SpiceVoiceIn *in = container_of (VAR_0, SpiceVoiceIn, VAR_0); struct audsettings VAR_2; #if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3
VAR_2.freq       = spice_server_get_best_record_rate(NULL); #else
VAR_2.freq       = SPICE_INTERFACE_RECORD_FREQ; #endif
VAR_2.nchannels  = SPICE_INTERFACE_RECORD_CHAN; VAR_2.fmt        = AUD_FMT_S16; VAR_2.endianness = AUDIO_HOST_ENDIANNESS; audio_pcm_init_info (&VAR_0->info, &VAR_2); VAR_0->samples = LINE_IN_SAMPLES; in->active = 0; in->sin.base.sif = &record_sif.base; qemu_spice_add_interface (&in->sin.base); #if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3
spice_server_set_record_rate(&in->sin, VAR_2.freq); #endif
return 0; }