aboutsummaryrefslogtreecommitdiffstats
path: root/audio/wavcapture.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:59 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:59 -0800
commitc27f813900a3c114562efbb8df1065e94766fc48 (patch)
treed95919283707dcab61009e27007374a745c9541e /audio/wavcapture.c
parent0852ad57fa372f9b2854e4df685eaba8d8ef6790 (diff)
downloadexternal_qemu-c27f813900a3c114562efbb8df1065e94766fc48.zip
external_qemu-c27f813900a3c114562efbb8df1065e94766fc48.tar.gz
external_qemu-c27f813900a3c114562efbb8df1065e94766fc48.tar.bz2
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'audio/wavcapture.c')
-rw-r--r--audio/wavcapture.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index 748b580..d6f733e 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -1,4 +1,6 @@
-#include "vl.h"
+#include "audio/audio.h"
+#include "qemu_file.h"
+#include "console.h"
typedef struct {
QEMUFile *f;
@@ -46,7 +48,7 @@ static void wav_destroy (void *opaque)
qemu_fseek (wav->f, 32, SEEK_CUR);
qemu_put_buffer (wav->f, dlen, 4);
- fclose (wav->f);
+ qemu_fclose (wav->f);
if (wav->path) {
qemu_free (wav->path);
}
@@ -133,7 +135,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
le_store (hdr + 28, freq << shift, 4);
le_store (hdr + 32, 1 << shift, 2);
- wav->f = fopen (path, "wb");
+ wav->f = qemu_fopen (path, "wb");
if (!wav->f) {
term_printf ("Failed to open wave file `%s'\nReason: %s\n",
path, strerror (errno));
@@ -151,6 +153,8 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
cap = AUD_add_capture (NULL, &as, &ops, wav);
if (!cap) {
term_printf ("Failed to add audio capture\n");
+ qemu_free (wav->path);
+ qemu_fclose (wav->f);
qemu_free (wav);
return -1;
}