diff libao2/ao_pcm.c @ 14327:54e42c7eb713

Default to audiodump.pcm with nowaveheader again, but document it in the manpage this time.
author reimar
date Mon, 03 Jan 2005 14:16:07 +0000
parents efa291d270b7
children de08cc60fd7e
line wrap: on
line diff
--- a/libao2/ao_pcm.c	Mon Jan 03 14:05:38 2005 +0000
+++ b/libao2/ao_pcm.c	Mon Jan 03 14:16:07 2005 +0000
@@ -88,14 +88,19 @@
 	};
 	// set defaults
 	ao_pcm_waveheader = 1;
-	file.str = "audiodump.wav";
-	file.len = 13;
+	file.str = NULL;
+	file.len = 0;
 	if (subopt_parse(ao_subdevice, subopts) != 0) {
 	  return 0;
 	}
+	if (file.len > 0) {
 	ao_outputfilename = malloc(file.len + 1);
 	memcpy(ao_outputfilename, file.str, file.len);
 	ao_outputfilename[file.len] = 0;
+	}
+	else
+	  ao_outputfilename =
+	      strdup((ao_pcm_waveheader)?"audiodump.wav":"audiodump.pcm");
 
 	/* bits is only equal to format if (format == 8) or (format == 16);
 	   this means that the following "if" is a kludge and should