summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-09-05 20:35:53 +0900
committerChanho Park <chanho61.park@samsung.com>2014-09-05 20:35:53 +0900
commit16b1353a36171ae06d63fd309f4772dbfb1da113 (patch)
treecf6c297ee81aba0d9b47f23d78a889667e7bce48 /audio
parenta15119db2ff5c2fdfdeb913b297bf8aa3399132e (diff)
downloadqemu-16b1353a36171ae06d63fd309f4772dbfb1da113.tar.gz
qemu-16b1353a36171ae06d63fd309f4772dbfb1da113.tar.bz2
qemu-16b1353a36171ae06d63fd309f4772dbfb1da113.zip
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'audio')
-rw-r--r--audio/Makefile.objs2
-rw-r--r--audio/alsaaudio.c12
-rw-r--r--audio/audio.c3
-rw-r--r--audio/audio_template.h15
-rw-r--r--audio/ossaudio.c6
-rw-r--r--audio/spiceaudio.c2
-rw-r--r--audio/wavcapture.c3
7 files changed, 14 insertions, 29 deletions
diff --git a/audio/Makefile.objs b/audio/Makefile.objs
index d71a87724..26a0ac950 100644
--- a/audio/Makefile.objs
+++ b/audio/Makefile.objs
@@ -14,4 +14,4 @@ common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
common-obj-y += wavcapture.o
$(obj)/audio.o $(obj)/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
-$(obj)/sdlaudio.o: QEMU_CFLAGS += $(SDL_CFLAGS)
+sdlaudio.o-cflags := $(SDL_CFLAGS)
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index e4e544263..74ead97d8 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -815,10 +815,8 @@ static void alsa_fini_out (HWVoiceOut *hw)
ldebug ("alsa_fini\n");
alsa_anal_close (&alsa->handle, &alsa->pollhlp);
- if (alsa->pcm_buf) {
- g_free (alsa->pcm_buf);
- alsa->pcm_buf = NULL;
- }
+ g_free(alsa->pcm_buf);
+ alsa->pcm_buf = NULL;
}
static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
@@ -978,10 +976,8 @@ static void alsa_fini_in (HWVoiceIn *hw)
alsa_anal_close (&alsa->handle, &alsa->pollhlp);
- if (alsa->pcm_buf) {
- g_free (alsa->pcm_buf);
- alsa->pcm_buf = NULL;
- }
+ g_free(alsa->pcm_buf);
+ alsa->pcm_buf = NULL;
}
static int alsa_run_in (HWVoiceIn *hw)
diff --git a/audio/audio.c b/audio/audio.c
index fc775110a..9d018e9de 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1812,8 +1812,7 @@ static const VMStateDescription vmstate_audio = {
.name = "audio",
.version_id = 1,
.minimum_version_id = 1,
- .minimum_version_id_old = 1,
- .fields = (VMStateField []) {
+ .fields = (VMStateField[]) {
VMSTATE_END_OF_LIST()
}
};
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 16f788077..817318853 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv)
static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw)
{
- if (HWBUF) {
- g_free (HWBUF);
- }
-
+ g_free (HWBUF);
HWBUF = NULL;
}
@@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw)
{
- if (sw->buf) {
- g_free (sw->buf);
- }
+ g_free (sw->buf);
if (sw->rate) {
st_rate_stop (sw->rate);
@@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) (
static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw)
{
glue (audio_pcm_sw_free_resources_, TYPE) (sw);
- if (sw->name) {
- g_free (sw->name);
- sw->name = NULL;
- }
+ g_free (sw->name);
+ sw->name = NULL;
}
static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 5a7371603..4db2ca65b 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw)
oss_anal_close (&oss->fd);
- if (oss->pcm_buf) {
- g_free (oss->pcm_buf);
- oss->pcm_buf = NULL;
- }
+ g_free(oss->pcm_buf);
+ oss->pcm_buf = NULL;
}
static int oss_run_in (HWVoiceIn *hw)
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index fceee50ad..7b79bedca 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -105,7 +105,7 @@ static int rate_get_samples (struct audio_pcm_info *info, SpiceRateCtl *rate)
bytes = muldiv64 (ticks, info->bytes_per_second, get_ticks_per_sec ());
samples = (bytes - rate->bytes_sent) >> info->shift;
if (samples < 0 || samples > 65536) {
- fprintf (stderr, "Resetting rate control (%" PRId64 " samples)\n", samples);
+ error_report("Resetting rate control (%" PRId64 " samples)", samples);
rate_start (rate);
samples = 0;
}
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index 9d9462322..6f6d79269 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -63,8 +63,7 @@ static void wav_destroy (void *opaque)
}
doclose:
if (fclose (wav->f)) {
- fprintf (stderr, "wav_destroy: fclose failed: %s",
- strerror (errno));
+ error_report("wav_destroy: fclose failed: %s", strerror(errno));
}
}