[MPlayer-cvslog] CVS: main mencoder.c, 1.288, 1.289 mplayer.c, 1.849, 1.850

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Jun 24 12:50:55 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv19546

Modified Files:
	mencoder.c mplayer.c 
Log Message:
make -srate work again, unify audio filter init and preinit.


Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -r1.288 -r1.289
--- mencoder.c	1 Jun 2005 09:01:41 -0000	1.288
+++ mencoder.c	24 Jun 2005 10:50:52 -0000	1.289
@@ -819,9 +819,9 @@
 
 mux_a->codec=out_audio_codec;
 
-ao_data.samplerate = force_srate ? force_srate : new_srate;
-ao_data.channels = audio_output_channels ? audio_output_channels : sh_audio->channels;
-ao_data.format = audio_output_format ? audio_output_format : sh_audio->sample_format;
+ao_data.samplerate = force_srate;
+ao_data.channels = 0;
+ao_data.format = audio_output_format;
 if(!preinit_audio_filters(sh_audio,
    // input:
    new_srate,
@@ -833,7 +833,7 @@
    }
 
 aparams.channels = ao_data.channels;
-aparams.sample_rate = force_srate ? force_srate : ao_data.samplerate;
+aparams.sample_rate = ao_data.samplerate;
 aparams.audio_preload = 1000 * audio_preload;
 if(mux_a->codec != ACODEC_COPY) {
     aencoder = new_audio_encoder(mux_a, &aparams);
@@ -841,7 +841,7 @@
         mencoder_exit(1, NULL);
     if(!init_audio_filters(sh_audio, 
         new_srate, sh_audio->channels, sh_audio->sample_format,  
-        aparams.sample_rate, aparams.channels, aencoder->input_format, 
+        &aparams.sample_rate, &aparams.channels, &aencoder->input_format, 
         aencoder->min_buffer_size, aencoder->max_buffer_size)) {
       mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_NoMatchingFilter);
       mencoder_exit(1,NULL);
@@ -951,9 +951,9 @@
 	    new_srate,
 	    sh_audio->channels,
 	    sh_audio->sample_format,
-	    mux_a->wf->nSamplesPerSec,
-	    mux_a->wf->nChannels,
-	    out_format,
+	    &mux_a->wf->nSamplesPerSec,
+	    &mux_a->wf->nChannels,
+	    &out_format,
 	    out_minsize,
 	    out_maxsize))
 	{

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.849
retrieving revision 1.850
diff -u -r1.849 -r1.850
--- mplayer.c	20 Jun 2005 23:07:34 -0000	1.849
+++ mplayer.c	24 Jun 2005 10:50:52 -0000	1.850
@@ -955,7 +955,7 @@
   }
   result =  init_audio_filters(sh_audio, new_srate,
            sh_audio->channels, sh_audio->sample_format,
-           ao_data->samplerate, ao_data->channels, ao_data->format,
+           &ao_data->samplerate, &ao_data->channels, &ao_data->format,
            ao_data->outburst * 4, ao_data->buffersize);
   mixer.afilter = sh_audio->afilter;
 #ifdef HAVE_NEW_GUI
@@ -2133,10 +2133,11 @@
 if(sh_audio){
   //const ao_info_t *info=audio_out->info;
   current_module="af_preinit";
-  ao_data.samplerate=force_srate?force_srate:sh_audio->samplerate*playback_speed;
-  ao_data.channels=audio_output_channels?audio_output_channels:sh_audio->channels;
-  ao_data.format=audio_output_format?audio_output_format:sh_audio->sample_format;
+  ao_data.samplerate=force_srate;
+  ao_data.channels=0;
+  ao_data.format=audio_output_format;
 #if 1
+  // first init to detect best values
   if(!preinit_audio_filters(sh_audio,
         // input:
         (int)(sh_audio->samplerate*playback_speed),




More information about the MPlayer-cvslog mailing list