diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-15 01:00:20 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-15 01:00:20 +0900 |
commit | 680ab52d9e151676b8f90d105b23d2d0d89b0471 (patch) | |
tree | 5a05e82900393d2e1ecdf034cf1735d4ebfaec98 /win32/wavewrite.c | |
parent | 428126ee4c8802a4b5f9c9ee491d54013857741b (diff) |
add fmdsp fft analyzer
Diffstat (limited to 'win32/wavewrite.c')
-rw-r--r-- | win32/wavewrite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/win32/wavewrite.c b/win32/wavewrite.c index 7c2d6da..37f6145 100644 --- a/win32/wavewrite.c +++ b/win32/wavewrite.c @@ -3,6 +3,7 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdlib.h> +#include <stdio.h> struct wavefile { HANDLE file; @@ -67,17 +68,16 @@ size_t wavewrite_write(struct wavefile *wavefile, const int16_t *buf, size_t fra } void wavewrite_close(struct wavefile *wavefile) { - LONG fp; uint32_t size; DWORD written; - if ((SetFilePointer(wavefile->file, 40, &fp, FILE_BEGIN) == INVALID_SET_FILE_POINTER) || (fp != 40)) { + if (SetFilePointer(wavefile->file, 40, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { goto cleanup; } size = wavefile->written_frames * 4; if (!WriteFile(wavefile->file, &size, sizeof(size), &written, 0) || (written != sizeof(size))) { goto cleanup; } - if ((SetFilePointer(wavefile->file, 4, &fp, FILE_BEGIN) == INVALID_SET_FILE_POINTER) || (fp != 4)) { + if (SetFilePointer(wavefile->file, 4, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { goto cleanup; } size += 4 + 8 + 16 + 8; |