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 151 le_store (hdr + 28, hw->info.freq << (bits16 + stereo), 4);
152 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 155 if (!wav->f) {
156 156 dolog ("Failed to open wave file `%s'\nReason: %s\n",
157 157 conf.wav_path, strerror (errno));
... ... @@ -185,7 +185,7 @@ static void wav_fini_out (HWVoiceOut *hw)
185 185 qemu_fseek (wav->f, 32, SEEK_CUR);
186 186 qemu_put_buffer (wav->f, dlen, 4);
187 187  
188   - fclose (wav->f);
  188 + qemu_fclose (wav->f);
189 189 wav->f = NULL;
190 190  
191 191 qemu_free (wav->pcm_buf);
... ...
audio/wavcapture.c
... ... @@ -46,7 +46,7 @@ static void wav_destroy (void *opaque)
46 46  
47 47 qemu_fseek (wav->f, 32, SEEK_CUR);
48 48 qemu_put_buffer (wav->f, dlen, 4);
49   - fclose (wav->f);
  49 + qemu_fclose (wav->f);
50 50 if (wav->path) {
51 51 qemu_free (wav->path);
52 52 }
... ... @@ -135,7 +135,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq,
135 135 le_store (hdr + 28, freq << shift, 4);
136 136 le_store (hdr + 32, 1 << shift, 2);
137 137  
138   - wav->f = fopen (path, "wb");
  138 + wav->f = qemu_fopen (path, "wb");
139 139 if (!wav->f) {
140 140 term_printf ("Failed to open wave file `%s'\nReason: %s\n",
141 141 path, strerror (errno));
... ...