[Mplayer-cvslog] CVS: main mplayer.c,1.653,1.654

Arpi of Ize arpi at mplayerhq.hu
Sat Jan 18 18:34:34 CET 2003


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv9975

Modified Files:
	mplayer.c 
Log Message:
2-pass libaf initialization to get better filter chain.
-channels, -format, -srate function changed, they affect codec & preinit
outformat only, use -af resample=XXX,channels=YYY,format=ZZZ to override.


Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.653
retrieving revision 1.654
diff -u -r1.653 -r1.654
--- mplayer.c	16 Jan 2003 23:03:06 -0000	1.653
+++ mplayer.c	18 Jan 2003 17:33:55 -0000	1.654
@@ -1625,13 +1625,29 @@
 
 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;
+#if 1
+  if(!preinit_audio_filters(sh_audio,
+        // input:
+        (int)(sh_audio->samplerate*playback_speed),
+	sh_audio->channels, sh_audio->sample_format, sh_audio->samplesize,
+	// output:
+	&ao_data.samplerate, &ao_data.channels, &ao_data.format,
+	audio_out_format_bits(ao_data.format)/8)){
+      mp_msg(MSGT_CPLAYER,MSGL_ERR,"Error at audio filter chain pre-init!\n");
+  } else {
+    mp_msg(MSGT_CPLAYER,MSGL_INFO,"AF_pre: %dHz %dch %s\n",
+      ao_data.samplerate, ao_data.channels,
+      audio_out_format_name(ao_data.format));
+  }
+#endif  
   current_module="ao2_init";
   if(!(audio_out=init_best_audio_out(audio_driver_list,
       (ao_plugin_cfg.plugin_list!=NULL), // plugin flag
-      force_srate?force_srate:sh_audio->samplerate*playback_speed,
-      audio_output_channels?audio_output_channels:
-      sh_audio->channels,audio_output_format?audio_output_format:
-      sh_audio->sample_format,0))){
+      ao_data.samplerate, ao_data.channels, ao_data.format,0))){
     // FAILED:
     mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CannotInitAO);
     uninit_player(INITED_ACODEC); // close codec
@@ -1639,11 +1655,11 @@
   } else {
     // SUCCESS:
     inited_flags|=INITED_AO;
-    mp_msg(MSGT_CPLAYER,MSGL_INFO,"AO: [%s] %dHz %dch %s\n",
+    mp_msg(MSGT_CPLAYER,MSGL_INFO,"AO: [%s] %dHz %dch %s (%d bps)\n",
       audio_out->info->short_name,
-      force_srate?force_srate:((int)(sh_audio->samplerate*playback_speed)),
-      sh_audio->channels,
-      audio_out_format_name(sh_audio->sample_format));
+      ao_data.samplerate, ao_data.channels,
+      audio_out_format_name(ao_data.format),
+      audio_out_format_bits(ao_data.format)/8 );
     mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_AODescription_AOAuthor,
       audio_out->info->name, audio_out->info->author);
     if(strlen(audio_out->info->comment) > 0)



More information about the MPlayer-cvslog mailing list