diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2000-05-29 06:34:02 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2000-05-29 06:34:02 +0000 |
commit | f76334001dd030262b572b69a3276e9433dfb410 (patch) | |
tree | 6c6c5346b8838c5cb2403ede0d5ee9fd8d29b8c0 /audio/libmikmod | |
parent | `sml-nj-devel' will be tracking SML/NJ working snapshots. Set NO_LATEST_LINK (diff) |
Get rid of those zero-sized `music.raw' files, known to anyone using
libmikmod or any software based on it.
Diffstat (limited to 'audio/libmikmod')
-rw-r--r-- | audio/libmikmod/files/patch-ad | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/audio/libmikmod/files/patch-ad b/audio/libmikmod/files/patch-ad new file mode 100644 index 000000000000..aa92fd2ec7d8 --- /dev/null +++ b/audio/libmikmod/files/patch-ad @@ -0,0 +1,32 @@ +--- drivers/drv_raw.c 2000/05/26 10:10:11 1.1 ++++ drivers/drv_raw.c 2000/05/26 10:11:48 +@@ -58,6 +58,7 @@ + static int rawout=-1; + static SBYTE *audiobuffer=NULL; + static CHAR *filename=NULL; ++static unsigned long counter=0; + + static void RAW_CommandLine(CHAR *cmdline) + { +@@ -113,13 +114,20 @@ + if (rawout!=-1) { + close(rawout); + rawout=-1; ++ if (counter==0) ++ unlink(filename?filename:FILENAME); ++ else ++ counter=0; + } + _mm_free(audiobuffer); + } + + static void RAW_Update(void) + { +- write(rawout,audiobuffer,VC_WriteBytes(audiobuffer,BUFFERSIZE)); ++ int num; ++ num=write(rawout,audiobuffer,VC_WriteBytes(audiobuffer,BUFFERSIZE)); ++ if (num>0) ++ counter+=num; + } + + static BOOL RAW_Reset(void) |