[MPlayer-cvslog] CVS: main/libao2 ao_pcm.c,1.24,1.25

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jan 3 11:06:30 CET 2005


Hi,

On Mon, Jan 03, 2005 at 01:57:45AM +0100, Felix Buenemann wrote:
> On Sunday 02 January 2005 23:38, Reimar Döffinger wrote:
> > On Sun, Jan 02, 2005 at 11:07:17PM +0100, Felix Buenemann wrote:
> > > On Sunday 02 January 2005 15:41, Reimar Döffinger CVS wrote:
> > > > Modified Files:
> > > >         ao_pcm.c
> > > > Log Message:
> > > > Add -ao pcm suboptions and remove -aofile and -waveheader options.
> > > > Base on idea by Olivier Rolland (billl at users dot sf dot net)
> > >
> > > The code is not equivalent to old behaviour, now if you specify no
> > > waveheader, then filename will be audiodump.wav not audiodump.pcm...
> >
> > I know. Maybe I should have mentioned it - but like this it is at least
> > consistent with the manpage.
> > I can think of a way to make it behave like before, but it's a bit
> > complicated. Do you think it is necessary?
> yes, I'd be rather irritated playing a file audiodump.wav with an application 
> capable of playing wave-files and it will throw up "unsupported file" or 
> something. While if it's named audiodump.pcm I'll make up my mind what it 
> is...

Does the attached patch look okay?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libao2/ao_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_pcm.c,v
retrieving revision 1.27
diff -u -r1.27 ao_pcm.c
--- libao2/ao_pcm.c	2 Jan 2005 16:39:03 -0000	1.27
+++ libao2/ao_pcm.c	3 Jan 2005 10:04:49 -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
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.834
diff -u -r1.834 mplayer.1
--- DOCS/man/en/mplayer.1	2 Jan 2005 14:41:46 -0000	1.834
+++ DOCS/man/en/mplayer.1	3 Jan 2005 10:05:19 -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


More information about the MPlayer-cvslog mailing list