[Mplayer-cvslog] CVS: main mencoder.c,1.65,1.66
Arpi of Ize
arpi at mplayer.dev.hu
Sun Jan 27 02:23:33 CET 2002
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv27101
Modified Files:
mencoder.c
Log Message:
audio copy fix
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- mencoder.c 27 Jan 2002 00:43:57 -0000 1.65
+++ mencoder.c 27 Jan 2002 01:23:23 -0000 1.66
@@ -554,7 +554,7 @@
} // if(out_video_codec)
-if(sh_audio && out_audio_codec){
+if(sh_audio && (out_audio_codec || !sh_audio->wf)){
// Go through the codec.conf and find the best codec...
sh_audio->codec=NULL;
if(audio_family!=-1) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family);
@@ -579,7 +579,7 @@
}
}
-if(sh_audio && out_audio_codec){
+if(sh_audio && (out_audio_codec || !sh_audio->wf)){
mp_msg(MSGT_MENCODER,MSGL_V,"Initializing audio codec...\n");
if(!init_audio(sh_audio)){
mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CouldntInitAudioCodec);
@@ -780,19 +780,24 @@
switch(mux_a->codec){
case ACODEC_COPY:
- mux_a->h.dwSampleSize=sh_audio->audio.dwSampleSize;
- mux_a->h.dwScale=sh_audio->audio.dwScale;
- mux_a->h.dwRate=sh_audio->audio.dwRate;
- if (sh_audio->wf)
+ if(sh_audio->audio.dwScale){
+ mux_a->h.dwSampleSize=sh_audio->audio.dwSampleSize;
+ mux_a->h.dwScale=sh_audio->audio.dwScale;
+ mux_a->h.dwRate=sh_audio->audio.dwRate;
+ } else {
+ mux_a->h.dwSampleSize=1;
+ mux_a->h.dwScale=1;
+ mux_a->h.dwRate=sh_audio->i_bps;
+ }
+ if (sh_audio->wf){
mux_a->wf=sh_audio->wf;
- else
- {
+ } else {
mux_a->wf = malloc(sizeof(WAVEFORMATEX));
mux_a->wf->nBlockAlign = mux_a->h.dwSampleSize;
- mux_a->wf->wFormatTag = sh_audio->sample_format;
+ mux_a->wf->wFormatTag = sh_audio->format;
mux_a->wf->nChannels = sh_audio->channels;
mux_a->wf->nSamplesPerSec = sh_audio->samplerate;
- mux_a->wf->nAvgBytesPerSec=mux_a->h.dwSampleSize*mux_a->wf->nSamplesPerSec;
+ mux_a->wf->nAvgBytesPerSec=sh_audio->i_bps; //mux_a->h.dwSampleSize*mux_a->wf->nSamplesPerSec;
mux_a->wf->wBitsPerSample = 16; // FIXME
mux_a->wf->cbSize=0; // FIXME for l3codeca.acm
}
More information about the MPlayer-cvslog
mailing list