aboutsummaryrefslogtreecommitdiffstats
path: root/audio/audio_template.h
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-05-10 18:37:10 -0700
committerDavid 'Digit' Turner <digit@android.com>2010-05-10 23:26:57 -0700
commita5d412078b8e7478d81df03710eacc7a21096ba2 (patch)
tree7b6fb338233657c9885bd94f08dee3aa2973c98f /audio/audio_template.h
parent20894ae3fa98f82da925fbeb72e616eef509758a (diff)
downloadexternal_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.zip
external_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.tar.gz
external_qemu-a5d412078b8e7478d81df03710eacc7a21096ba2.tar.bz2
Upstream: Replace sys-queue.h with qemu-queue.h
Change-Id: I5c51f54a7fe2ea702420429bbf0c789ed6d8c534
Diffstat (limited to 'audio/audio_template.h')
-rw-r--r--audio/audio_template.h48
1 files changed, 23 insertions, 25 deletions
diff --git a/audio/audio_template.h b/audio/audio_template.h
index d6c1037..9f75f19 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -184,12 +184,12 @@ static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw)
static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
{
- LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
+ QLIST_INSERT_HEAD (&hw->sw_head, sw, entries);
}
static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw)
{
- LIST_REMOVE (sw, entries);
+ QLIST_REMOVE (sw, entries);
}
static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
@@ -201,7 +201,7 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
#ifdef DAC
audio_detach_capture (hw);
#endif
- LIST_REMOVE (hw, entries);
+ QLIST_REMOVE (hw, entries);
glue (s->nb_hw_voices_, TYPE) += 1;
glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
BEGIN_NOSIGALRM
@@ -270,9 +270,9 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as)
}
hw->pcm_ops = drv->pcm_ops;
- LIST_INIT (&hw->sw_head);
+ QLIST_INIT (&hw->sw_head);
#ifdef DAC
- LIST_INIT (&hw->cap_head);
+ QLIST_INIT (&hw->cap_head);
#endif
BEGIN_NOSIGALRM
err = glue (hw->pcm_ops->init_, TYPE) (hw, as);
@@ -299,7 +299,7 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as)
goto err1;
}
- LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
+ QLIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
glue (s->nb_hw_voices_, TYPE) -= 1;
#ifdef DAC
audio_attach_capture (hw);
@@ -409,7 +409,7 @@ SW *glue (AUD_open_, TYPE) (
SW *sw,
const char *name,
void *callback_opaque ,
- audio_callback_fn_t callback_fn,
+ audio_callback_fn callback_fn,
struct audsettings *as
)
{
@@ -492,32 +492,30 @@ SW *glue (AUD_open_, TYPE) (
}
}
- if (sw) {
- sw->card = card;
- sw->vol = nominal_volume;
- sw->callback.fn = callback_fn;
- sw->callback.opaque = callback_opaque;
+ sw->card = card;
+ sw->vol = nominal_volume;
+ sw->callback.fn = callback_fn;
+ sw->callback.opaque = callback_opaque;
#ifdef DAC
- if (live) {
- int mixed =
- (live << old_sw->info.shift)
- * old_sw->info.bytes_per_second
- / sw->info.bytes_per_second;
+ if (live) {
+ int mixed =
+ (live << old_sw->info.shift)
+ * old_sw->info.bytes_per_second
+ / sw->info.bytes_per_second;
#ifdef DEBUG_PLIVE
- dolog ("Silence will be mixed %d\n", mixed);
+ dolog ("Silence will be mixed %d\n", mixed);
#endif
- sw->total_hw_samples_mixed += mixed;
- }
+ sw->total_hw_samples_mixed += mixed;
+ }
#endif
#ifdef DEBUG_AUDIO
- dolog ("%s\n", name);
- audio_pcm_print_info ("hw", &sw->hw->info);
- audio_pcm_print_info ("sw", &sw->info);
+ dolog ("%s\n", name);
+ audio_pcm_print_info ("hw", &sw->hw->info);
+ audio_pcm_print_info ("sw", &sw->info);
#endif
- }
return sw;
@@ -563,7 +561,7 @@ uint64_t glue (AUD_get_elapsed_usec_, TYPE) (SW *sw, QEMUAudioTimeStamp *ts)
return 0;
}
- return (delta * sw->hw->info.freq) / 1000000;
+ return muldiv64 (delta, sw->hw->info.freq, 1000000);
}
#undef TYPE