summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_pcm.c')
-rw-r--r--audio/out/ao_pcm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/audio/out/ao_pcm.c b/audio/out/ao_pcm.c
index 4097aa3bd6..cf13c478ac 100644
--- a/audio/out/ao_pcm.c
+++ b/audio/out/ao_pcm.c
@@ -34,7 +34,7 @@
#include "common/msg.h"
#include "osdep/endian.h"
-#ifdef __MINGW32__
+#ifdef _WIN32
// for GetFileType to detect pipes
#include <windows.h>
#include <io.h>
@@ -86,7 +86,7 @@ static void write_wave_header(struct ao *ao, FILE *fp, uint64_t data_length)
fput16le(WAV_ID_FORMAT_EXTENSIBLE, fp);
fput16le(ao->channels.num, fp);
fput32le(ao->samplerate, fp);
- fput32le(ao->bps, fp);
+ fput32le(MPCLAMP(ao->bps, 0, UINT32_MAX), fp);
fput16le(ao->channels.num * (bits / 8), fp);
fput16le(bits, fp);
@@ -145,7 +145,7 @@ static int init(struct ao *ao)
if (!ao_chmap_sel_adjust(ao, &sel, &ao->channels))
return -1;
- ao->bps = ao->channels.num * ao->samplerate * af_fmt_to_bytes(ao->format);
+ ao->bps = ao->channels.num * (int64_t)ao->samplerate * af_fmt_to_bytes(ao->format);
MP_INFO(ao, "File: %s (%s)\nPCM: Samplerate: %d Hz Channels: %d Format: %s\n",
outputfilename,
@@ -172,7 +172,7 @@ static void uninit(struct ao *ao)
if (priv->waveheader) { // Rewrite wave header
bool broken_seek = false;
-#ifdef __MINGW32__
+#ifdef _WIN32
// Windows, in its usual idiocy "emulates" seeks on pipes so it always
// looks like they work. So we have to detect them brute-force.
broken_seek = FILE_TYPE_DISK !=