aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
commit72cf2d4f0e181d0d3a3122e04129c58a95da713e (patch)
tree4d13c505a692104406090e94dd654fd1e98ec34e /audio
parent620150dc9c1827cdddfa64a0fada7af5f7ee405b (diff)
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio.c38
-rw-r--r--audio/audio.h6
-rw-r--r--audio/audio_int.h30
-rw-r--r--audio/audio_template.h12
4 files changed, 43 insertions, 43 deletions
diff --git a/audio/audio.c b/audio/audio.c
index aa9ea3ea0e..e223cf3e82 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -766,8 +766,8 @@ static void audio_detach_capture (HWVoiceOut *hw)
sw->rate = NULL;
}
- LIST_REMOVE (sw, entries);
- LIST_REMOVE (sc, entries);
+ QLIST_REMOVE (sw, entries);
+ QLIST_REMOVE (sc, entries);
qemu_free (sc);
if (was_active) {
/* We have removed soft voice from the capture:
@@ -811,8 +811,8 @@ static int audio_attach_capture (HWVoiceOut *hw)
qemu_free (sw);
return -1;
}
- LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
- LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
+ QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
+ QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
#ifdef DEBUG_CAPTURE
asprintf (&sw->name, "for %p %d,%d,%d",
hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
@@ -1803,9 +1803,9 @@ static void audio_init (void)
return;
}
- LIST_INIT (&s->hw_head_out);
- LIST_INIT (&s->hw_head_in);
- LIST_INIT (&s->cap_head);
+ QLIST_INIT (&s->hw_head_out);
+ QLIST_INIT (&s->hw_head_in);
+ QLIST_INIT (&s->cap_head);
atexit (audio_atexit);
s->ts = qemu_new_timer (vm_clock, audio_timer, s);
@@ -1887,7 +1887,7 @@ static void audio_init (void)
"(Audio can continue looping even after stopping the VM)\n");
}
- LIST_INIT (&s->card_head);
+ QLIST_INIT (&s->card_head);
register_savevm ("audio", 0, 1, audio_save, audio_load, s);
}
@@ -1896,12 +1896,12 @@ void AUD_register_card (const char *name, QEMUSoundCard *card)
audio_init ();
card->name = qemu_strdup (name);
memset (&card->entries, 0, sizeof (card->entries));
- LIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
+ QLIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries);
}
void AUD_remove_card (QEMUSoundCard *card)
{
- LIST_REMOVE (card, entries);
+ QLIST_REMOVE (card, entries);
qemu_free (card->name);
}
@@ -1933,7 +1933,7 @@ CaptureVoiceOut *AUD_add_capture (
cap = audio_pcm_capture_find_specific (as);
if (cap) {
- LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
+ QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
return cap;
}
else {
@@ -1948,8 +1948,8 @@ CaptureVoiceOut *AUD_add_capture (
}
hw = &cap->hw;
- LIST_INIT (&hw->sw_head);
- LIST_INIT (&cap->cb_head);
+ QLIST_INIT (&hw->sw_head);
+ QLIST_INIT (&cap->cb_head);
/* XXX find a more elegant way */
hw->samples = 4096 * 4;
@@ -1977,8 +1977,8 @@ CaptureVoiceOut *AUD_add_capture (
[hw->info.swap_endianness]
[audio_bits_to_index (hw->info.bits)];
- LIST_INSERT_HEAD (&s->cap_head, cap, entries);
- LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
+ QLIST_INSERT_HEAD (&s->cap_head, cap, entries);
+ QLIST_INSERT_HEAD (&cap->cb_head, cb, entries);
hw = NULL;
while ((hw = audio_pcm_hw_find_any_out (hw))) {
@@ -2004,7 +2004,7 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
if (cb->opaque == cb_opaque) {
cb->ops.destroy (cb_opaque);
- LIST_REMOVE (cb, entries);
+ QLIST_REMOVE (cb, entries);
qemu_free (cb);
if (!cap->cb_head.lh_first) {
@@ -2021,12 +2021,12 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
st_rate_stop (sw->rate);
sw->rate = NULL;
}
- LIST_REMOVE (sw, entries);
- LIST_REMOVE (sc, entries);
+ QLIST_REMOVE (sw, entries);
+ QLIST_REMOVE (sc, entries);
qemu_free (sc);
sw = sw1;
}
- LIST_REMOVE (cap, entries);
+ QLIST_REMOVE (cap, entries);
qemu_free (cap);
}
return;
diff --git a/audio/audio.h b/audio/audio.h
index dec86e5f77..f234ad0f54 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -25,7 +25,7 @@
#define QEMU_AUDIO_H
#include "config-host.h"
-#include "sys-queue.h"
+#include "qemu-queue.h"
typedef void (*audio_callback_fn_t) (void *opaque, int avail);
@@ -70,7 +70,7 @@ struct capture_ops {
typedef struct CaptureState {
void *opaque;
struct capture_ops ops;
- LIST_ENTRY (CaptureState) entries;
+ QLIST_ENTRY (CaptureState) entries;
} CaptureState;
typedef struct SWVoiceOut SWVoiceOut;
@@ -79,7 +79,7 @@ typedef struct SWVoiceIn SWVoiceIn;
typedef struct QEMUSoundCard {
char *name;
- LIST_ENTRY (QEMUSoundCard) entries;
+ QLIST_ENTRY (QEMUSoundCard) entries;
} QEMUSoundCard;
typedef struct QEMUAudioTimeStamp {
diff --git a/audio/audio_int.h b/audio/audio_int.h
index d930d0790e..ce791ee46c 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -80,10 +80,10 @@ typedef struct HWVoiceOut {
struct st_sample *mix_buf;
int samples;
- LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
- LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
+ QLIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
+ QLIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
struct audio_pcm_ops *pcm_ops;
- LIST_ENTRY (HWVoiceOut) entries;
+ QLIST_ENTRY (HWVoiceOut) entries;
} HWVoiceOut;
typedef struct HWVoiceIn {
@@ -100,9 +100,9 @@ typedef struct HWVoiceIn {
struct st_sample *conv_buf;
int samples;
- LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
+ QLIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
struct audio_pcm_ops *pcm_ops;
- LIST_ENTRY (HWVoiceIn) entries;
+ QLIST_ENTRY (HWVoiceIn) entries;
} HWVoiceIn;
struct SWVoiceOut {
@@ -119,7 +119,7 @@ struct SWVoiceOut {
char *name;
struct mixeng_volume vol;
struct audio_callback callback;
- LIST_ENTRY (SWVoiceOut) entries;
+ QLIST_ENTRY (SWVoiceOut) entries;
};
struct SWVoiceIn {
@@ -135,7 +135,7 @@ struct SWVoiceIn {
char *name;
struct mixeng_volume vol;
struct audio_callback callback;
- LIST_ENTRY (SWVoiceIn) entries;
+ QLIST_ENTRY (SWVoiceIn) entries;
};
struct audio_driver {
@@ -169,20 +169,20 @@ struct audio_pcm_ops {
struct capture_callback {
struct audio_capture_ops ops;
void *opaque;
- LIST_ENTRY (capture_callback) entries;
+ QLIST_ENTRY (capture_callback) entries;
};
struct CaptureVoiceOut {
HWVoiceOut hw;
void *buf;
- LIST_HEAD (cb_listhead, capture_callback) cb_head;
- LIST_ENTRY (CaptureVoiceOut) entries;
+ QLIST_HEAD (cb_listhead, capture_callback) cb_head;
+ QLIST_ENTRY (CaptureVoiceOut) entries;
};
struct SWVoiceCap {
SWVoiceOut sw;
CaptureVoiceOut *cap;
- LIST_ENTRY (SWVoiceCap) entries;
+ QLIST_ENTRY (SWVoiceCap) entries;
};
struct AudioState {
@@ -190,10 +190,10 @@ struct AudioState {
void *drv_opaque;
QEMUTimer *ts;
- LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
- LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
- LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
- LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
+ QLIST_HEAD (card_listhead, QEMUSoundCard) card_head;
+ QLIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
+ QLIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
+ QLIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
int nb_hw_voices_out;
int nb_hw_voices_in;
int vm_running;
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 0ffca652f5..e65d834ac9 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);
glue (hw->pcm_ops->fini_, TYPE) (hw);
@@ -267,9 +267,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
if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
goto err0;
@@ -294,7 +294,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);