Commit e70332b376ca6e7ca3357d8ce32b12c9a90da545

Authored by bellard
1 parent faea38e7

use QEMUFile API


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2087 c046a42c-6fe2-441c-8c8c-71466251a162
audio/wavaudio.c
@@ -151,7 +151,7 @@ static int wav_init_out (HWVoiceOut *hw, audsettings_t *as) @@ -151,7 +151,7 @@ static int wav_init_out (HWVoiceOut *hw, audsettings_t *as)
151 le_store (hdr + 28, hw->info.freq << (bits16 + stereo), 4); 151 le_store (hdr + 28, hw->info.freq << (bits16 + stereo), 4);
152 le_store (hdr + 32, 1 << (bits16 + stereo), 2); 152 le_store (hdr + 32, 1 << (bits16 + stereo), 2);
153 153
154 - wav->f = fopen (conf.wav_path, "wb"); 154 + wav->f = qemu_fopen (conf.wav_path, "wb");
155 if (!wav->f) { 155 if (!wav->f) {
156 dolog ("Failed to open wave file `%s'\nReason: %s\n", 156 dolog ("Failed to open wave file `%s'\nReason: %s\n",
157 conf.wav_path, strerror (errno)); 157 conf.wav_path, strerror (errno));
@@ -185,7 +185,7 @@ static void wav_fini_out (HWVoiceOut *hw) @@ -185,7 +185,7 @@ static void wav_fini_out (HWVoiceOut *hw)
185 qemu_fseek (wav->f, 32, SEEK_CUR); 185 qemu_fseek (wav->f, 32, SEEK_CUR);
186 qemu_put_buffer (wav->f, dlen, 4); 186 qemu_put_buffer (wav->f, dlen, 4);
187 187
188 - fclose (wav->f); 188 + qemu_fclose (wav->f);
189 wav->f = NULL; 189 wav->f = NULL;
190 190
191 qemu_free (wav->pcm_buf); 191 qemu_free (wav->pcm_buf);
audio/wavcapture.c
@@ -46,7 +46,7 @@ static void wav_destroy (void *opaque) @@ -46,7 +46,7 @@ static void wav_destroy (void *opaque)
46 46
47 qemu_fseek (wav->f, 32, SEEK_CUR); 47 qemu_fseek (wav->f, 32, SEEK_CUR);
48 qemu_put_buffer (wav->f, dlen, 4); 48 qemu_put_buffer (wav->f, dlen, 4);
49 - fclose (wav->f); 49 + qemu_fclose (wav->f);
50 if (wav->path) { 50 if (wav->path) {
51 qemu_free (wav->path); 51 qemu_free (wav->path);
52 } 52 }
@@ -135,7 +135,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq, @@ -135,7 +135,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
135 le_store (hdr + 28, freq << shift, 4); 135 le_store (hdr + 28, freq << shift, 4);
136 le_store (hdr + 32, 1 << shift, 2); 136 le_store (hdr + 32, 1 << shift, 2);
137 137
138 - wav->f = fopen (path, "wb"); 138 + wav->f = qemu_fopen (path, "wb");
139 if (!wav->f) { 139 if (!wav->f) {
140 term_printf ("Failed to open wave file `%s'\nReason: %s\n", 140 term_printf ("Failed to open wave file `%s'\nReason: %s\n",
141 path, strerror (errno)); 141 path, strerror (errno));