[MPlayer-cvslog] CVS: main/libmpcodecs dec_audio.c, 1.37, 1.38 dec_audio.h, 1.8, 1.9

Alex Beregszaszi syncmail at mplayerhq.hu
Fri Feb 25 12:11:09 CET 2005


CVS change done by Alex Beregszaszi

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

Modified Files:
	dec_audio.c dec_audio.h 
Log Message:
finally remove the refences to bps outside libaf. also simplification of some messages and removed redundants

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- dec_audio.c	25 Feb 2005 10:39:16 -0000	1.37
+++ dec_audio.c	25 Feb 2005 11:11:07 -0000	1.38
@@ -265,32 +265,29 @@
 
  /* Init audio filters */
 int preinit_audio_filters(sh_audio_t *sh_audio, 
-	int in_samplerate, int in_channels, int in_format, int in_bps,
-	int* out_samplerate, int* out_channels, int* out_format, int out_bps){
-  char strbuf[200];
+	int in_samplerate, int in_channels, int in_format,
+	int* out_samplerate, int* out_channels, int* out_format){
   af_stream_t* afs=malloc(sizeof(af_stream_t));
   memset(afs,0,sizeof(af_stream_t));
 
   // input format: same as codec's output format:
   afs->input.rate   = in_samplerate;
   afs->input.nch    = in_channels;
-//  afs->input.format = af_format_decode(in_format);
   afs->input.format = in_format;
-  afs->input.bps    = in_bps;
+  af_fix_parameters(&(afs->input));
 
   // output format: same as ao driver's input format (if missing, fallback to input)
   afs->output.rate   = *out_samplerate ? *out_samplerate : afs->input.rate;
   afs->output.nch    = *out_channels ? *out_channels : afs->input.nch;
-//  afs->output.format = *out_format ? af_format_decode(*out_format) : afs->input.format;
   afs->output.format = *out_format ? *out_format : afs->input.format;
-  afs->output.bps    = out_bps ? out_bps : afs->input.bps;
+  af_fix_parameters(&(afs->output));
 
   // filter config:  
   memcpy(&afs->cfg,&af_cfg,sizeof(af_cfg_t));
   
-  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Checking audio filter chain for %dHz/%dch/%dbit -> %dHz/%dch/%dbit...\n",
-      afs->input.rate,afs->input.nch,afs->input.bps*8,
-      afs->output.rate,afs->output.nch,afs->output.bps*8);
+  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Checking audio filter chain for %dHz/%dch/%s -> %dHz/%dch/%s...\n",
+      afs->input.rate,afs->input.nch,af_fmt2str_short(afs->input.format),
+      afs->output.rate,afs->output.nch,af_fmt2str_short(afs->output.format));
   
   // let's autoprobe it!
   if(0 != af_init(afs,0)){
@@ -300,12 +297,11 @@
   
   *out_samplerate=afs->output.rate;
   *out_channels=afs->output.nch;
-//  *out_format=af_format_encode((void*)(&afs->output));
   *out_format=afs->output.format;
-  
-  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "AF_pre: af format: %d bps, %d ch, %d hz, %s\n",
-      afs->output.bps, afs->output.nch, afs->output.rate,
-      af_fmt2str(afs->output.format,strbuf,200));
+
+  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "AF_pre: %dHz/%dch/%s\n",
+      afs->output.rate, afs->output.nch,
+      af_fmt2str_short(afs->output.format));
   
   sh_audio->afilter=(void*)afs;
   return 1;
@@ -313,8 +309,8 @@
 
  /* Init audio filters */
 int init_audio_filters(sh_audio_t *sh_audio, 
-	int in_samplerate, int in_channels, int in_format, int in_bps,
-	int out_samplerate, int out_channels, int out_format, int out_bps,
+	int in_samplerate, int in_channels, int in_format,
+	int out_samplerate, int out_channels, int out_format,
 	int out_minsize, int out_maxsize){
   af_stream_t* afs=sh_audio->afilter;
   if(!afs){
@@ -325,23 +321,21 @@
   // input format: same as codec's output format:
   afs->input.rate   = in_samplerate;
   afs->input.nch    = in_channels;
-//  afs->input.format = af_format_decode(in_format);
   afs->input.format = in_format;
-  afs->input.bps    = in_bps;
+  af_fix_parameters(&(afs->input));
 
   // output format: same as ao driver's input format (if missing, fallback to input)
   afs->output.rate   = out_samplerate ? out_samplerate : afs->input.rate;
   afs->output.nch    = out_channels ? out_channels : afs->input.nch;
-//  afs->output.format = af_format_decode(out_format ? out_format : afs->input.format);
   afs->output.format = out_format ? out_format : afs->input.format;
-  afs->output.bps    = out_bps ? out_bps : afs->input.bps;
+  af_fix_parameters(&(afs->output));
 
   // filter config:  
   memcpy(&afs->cfg,&af_cfg,sizeof(af_cfg_t));
   
-  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Building audio filter chain for %dHz/%dch/%dbit -> %dHz/%dch/%dbit...\n",
-      afs->input.rate,afs->input.nch,afs->input.bps*8,
-      afs->output.rate,afs->output.nch,afs->output.bps*8);
+  mp_msg(MSGT_DECAUDIO, MSGL_INFO, "Building audio filter chain for %dHz/%dch/%s -> %dHz/%dch/%s...\n",
+      afs->input.rate,afs->input.nch,af_fmt2str_short(afs->input.format),
+      afs->output.rate,afs->output.nch,af_fmt2str_short(afs->output.format));
   
   // let's autoprobe it!
   if(0 != af_init(afs,1)){
@@ -416,9 +410,8 @@
   afd.len=declen;
   afd.rate=sh_audio->samplerate;
   afd.nch=sh_audio->channels;
-//  afd.format=af_format_decode(sh_audio->sample_format);
   afd.format=sh_audio->sample_format;
-  afd.bps=sh_audio->samplesize;
+  af_fix_parameters(&afd);
   //pafd=&afd;
 //  printf("\nAF: %d --> ",declen);
   pafd=af_play(sh_audio->afilter,&afd);
@@ -460,3 +453,7 @@
   // default skip code:
   ds_fill_buffer(sh_audio->ds);  // skip block
 }
+
+void adjust_volume()
+{
+}

Index: dec_audio.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_audio.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dec_audio.h	2 Feb 2003 02:42:58 -0000	1.8
+++ dec_audio.h	25 Feb 2005 11:11:07 -0000	1.9
@@ -11,9 +11,9 @@
 extern void uninit_audio(sh_audio_t *sh_audio);
 
 extern int init_audio_filters(sh_audio_t *sh_audio, 
-	int in_samplerate, int in_channels, int in_format, int in_bps,
-	int out_samplerate, int out_channels, int out_format, int out_bps,
+	int in_samplerate, int in_channels, int in_format,
+	int out_samplerate, int out_channels, int out_format,
 	int out_minsize, int out_maxsize);
 extern int preinit_audio_filters(sh_audio_t *sh_audio,
-        int in_samplerate, int in_channels, int in_format, int in_bps,
-        int* out_samplerate, int* out_channels, int* out_format, int out_bps);
+        int in_samplerate, int in_channels, int in_format,
+        int* out_samplerate, int* out_channels, int* out_format);




More information about the MPlayer-cvslog mailing list