aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2000-05-29 14:34:02 +0800
committersobomax <sobomax@FreeBSD.org>2000-05-29 14:34:02 +0800
commit64c7c0b47249d2397b6a3ec32461c723bd7b5e58 (patch)
treebbfa5b4879675fd2c2ccab1deef76cd30ee9800e /audio
parent7fd3ebbe4c31a739be9a2ae90e3ace788160ffe2 (diff)
downloadfreebsd-ports-gnome-64c7c0b47249d2397b6a3ec32461c723bd7b5e58.tar.gz
freebsd-ports-gnome-64c7c0b47249d2397b6a3ec32461c723bd7b5e58.tar.zst
freebsd-ports-gnome-64c7c0b47249d2397b6a3ec32461c723bd7b5e58.zip
Get rid of those zero-sized `music.raw' files, known to anyone using
libmikmod or any software based on it.
Diffstat (limited to 'audio')
-rw-r--r--audio/libmikmod/files/patch-ad32
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)