changeset 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 9261d7dcf5e7
children fb9bf2e782a9
files DOCS/man/en/mplayer.1 libao2/ao_pcm.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Mon Jan 03 14:05:38 2005 +0000
+++ b/DOCS/man/en/mplayer.1	Mon Jan 03 14:16:07 2005 +0000
@@ -1909,6 +1909,7 @@
 .IPs file=<filename>
 Write the sound to <filename> instead of the default
 audiodump.wav.
+If nowaveheader is specified, the default is audiodump.pcm.
 .REss
 .PD 1
 .RS
--- 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