Revision e84a4fed audio/wavcapture.c
b/audio/wavcapture.c | ||
---|---|---|
34 | 34 |
uint32_t datalen = wav->bytes; |
35 | 35 |
uint32_t rifflen = datalen + 36; |
36 | 36 |
|
37 |
if (!wav->f) { |
|
38 |
return; |
|
39 |
} |
|
40 |
|
|
41 |
le_store (rlen, rifflen, 4); |
|
42 |
le_store (dlen, datalen, 4); |
|
43 |
|
|
44 |
qemu_fseek (wav->f, 4, SEEK_SET); |
|
45 |
qemu_put_buffer (wav->f, rlen, 4); |
|
46 |
|
|
47 |
qemu_fseek (wav->f, 32, SEEK_CUR); |
|
48 |
qemu_put_buffer (wav->f, dlen, 4); |
|
49 |
qemu_fclose (wav->f); |
|
50 |
if (wav->path) { |
|
51 |
qemu_free (wav->path); |
|
37 |
if (wav->f) { |
|
38 |
le_store (rlen, rifflen, 4); |
|
39 |
le_store (dlen, datalen, 4); |
|
40 |
|
|
41 |
qemu_fseek (wav->f, 4, SEEK_SET); |
|
42 |
qemu_put_buffer (wav->f, rlen, 4); |
|
43 |
|
|
44 |
qemu_fseek (wav->f, 32, SEEK_CUR); |
|
45 |
qemu_put_buffer (wav->f, dlen, 4); |
|
46 |
qemu_fclose (wav->f); |
|
52 | 47 |
} |
48 |
|
|
49 |
qemu_free (wav->path); |
|
53 | 50 |
} |
54 | 51 |
|
55 | 52 |
static void wav_capture (void *opaque, void *buf, int size) |
... | ... | |
153 | 150 |
cap = AUD_add_capture (NULL, &as, &ops, wav); |
154 | 151 |
if (!cap) { |
155 | 152 |
term_printf ("Failed to add audio capture\n"); |
153 |
qemu_free (wav->path); |
|
154 |
qemu_fclose (wav->f); |
|
156 | 155 |
qemu_free (wav); |
157 | 156 |
return -1; |
158 | 157 |
} |
Also available in: Unified diff