SW *sw,
HW *hw,
const char *name,
- audsettings_t *as,
- int endian
+ audsettings_t *as
)
{
int err;
- audio_pcm_init_info (&sw->info, as, audio_need_to_swap_endian (endian));
+ audio_pcm_init_info (&sw->info, as);
sw->hw = hw;
sw->active = 0;
#ifdef DAC
#endif
[sw->info.nchannels == 2]
[sw->info.sign]
- [sw->info.swap_endian]
+ [sw->info.swap_endianness]
[sw->info.bits == 16];
sw->name = qemu_strdup (name);
HW *hw = *hwp;
if (!hw->sw_head.lh_first) {
+#ifdef DAC
+ audio_detach_capture (hw);
+#endif
LIST_REMOVE (hw, entries);
glue (s->nb_hw_voices_, TYPE) += 1;
glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
hw->pcm_ops = drv->pcm_ops;
LIST_INIT (&hw->sw_head);
-
+#ifdef DAC
+ LIST_INIT (&hw->cap_head);
+#endif
if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
goto err0;
}
#endif
[hw->info.nchannels == 2]
[hw->info.sign]
- [hw->info.swap_endian]
+ [hw->info.swap_endianness]
[hw->info.bits == 16];
if (glue (audio_pcm_hw_alloc_resources_, TYPE) (hw)) {
LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
glue (s->nb_hw_voices_, TYPE) -= 1;
+#ifdef DAC
+ audio_attach_capture (s, hw);
+#endif
return hw;
err1:
static SW *glue (audio_pcm_create_voice_pair_, TYPE) (
AudioState *s,
const char *sw_name,
- audsettings_t *as,
- int sw_endian
+ audsettings_t *as
)
{
SW *sw;
glue (audio_pcm_hw_add_sw_, TYPE) (hw, sw);
- if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, sw_name, as, sw_endian)) {
+ if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, sw_name, as)) {
goto err3;
}
const char *name,
void *callback_opaque ,
audio_callback_fn_t callback_fn,
- audsettings_t *as,
- int sw_endian
+ audsettings_t *as
)
{
AudioState *s;
s = card->audio;
- if (audio_bug (AUDIO_FUNC, audio_validate_settigs (as))) {
+ if (audio_bug (AUDIO_FUNC, audio_validate_settings (as))) {
audio_print_settings (as);
goto fail;
}
}
glue (audio_pcm_sw_fini_, TYPE) (sw);
- if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, name, as, sw_endian)) {
+ if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, name, as)) {
goto fail;
}
}
else {
- sw = glue (audio_pcm_create_voice_pair_, TYPE) (s, name, as, sw_endian);
+ sw = glue (audio_pcm_create_voice_pair_, TYPE) (s, name, as);
if (!sw) {
dolog ("Failed to create voice `%s'\n", name);
return NULL;