From 680ab52d9e151676b8f90d105b23d2d0d89b0471 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 15 Apr 2017 01:00:20 +0900 Subject: add fmdsp fft analyzer --- win32/wavewrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win32/wavewrite.c') 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 #include +#include 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; -- cgit v1.2.3