[MPlayer-dev-eng] [PATCH] make -format to work with -ao pcm:nowaveheader
Giacomo Comes
comes at naic.edu
Mon Aug 14 21:15:21 CEST 2006
On Mon, Aug 14, 2006 at 09:00:37PM +0200, Ivo wrote:
> On Monday 14 August 2006 20:22, Giacomo Comes wrote:
> > + } else {
> > + af_fmt2bits(format);
> > + }
>
> Shouldn't that be bits = af_fmt2bits(format); ?
Yes of course.
Giacomo
-------------- next part --------------
diff -Nraub mplayer.ori/help/help_mp-en.h mplayer/help/help_mp-en.h
--- mplayer.ori/help/help_mp-en.h 2006-08-07 10:13:55.000000000 -0400
+++ mplayer/help/help_mp-en.h 2006-08-14 14:11:55.000000000 -0400
@@ -1092,7 +1092,8 @@
// This one desn't even have any mp_msg nor printf's?? [CHECK]
// ao_pcm.c
-#define MSGTR_AO_PCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n"
+#define MSGTR_AO_PCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format: %s\n"
+#define MSGTR_AO_PCM_RawInfo "[AO PCM] Info: Use -format to set the format of RAW PCM files\n"
#define MSGTR_AO_PCM_HintInfo "[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast\n[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).\n"
#define MSGTR_AO_PCM_CantOpenOutputFile "[AO PCM] Failed to open %s for writing!\n"
diff -Nraub mplayer.ori/libao2/ao_pcm.c mplayer/libao2/ao_pcm.c
--- mplayer.ori/libao2/ao_pcm.c 2006-06-05 15:46:03.000000000 -0400
+++ mplayer/libao2/ao_pcm.c 2006-08-14 15:14:13.000000000 -0400
@@ -102,6 +102,7 @@
this means that the following "if" is a kludge and should
really be a switch to be correct in all cases */
+ if(ao_pcm_waveheader) {
bits=8;
switch(format){
case AF_FORMAT_S8:
@@ -113,6 +114,9 @@
bits=16;
break;
}
+ } else {
+ bits=af_fmt2bits(format);
+ }
ao_data.outburst = 65536;
ao_data.buffersize= 2*65536;
@@ -133,6 +137,8 @@
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename,
(ao_pcm_waveheader?"WAVE":"RAW PCM"), rate,
(channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format));
+ if(!ao_pcm_waveheader)
+ mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_RawInfo);
mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo);
fp = fopen(ao_outputfilename, "wb");
More information about the MPlayer-dev-eng
mailing list