[MPlayer-cvslog] CVS: main/libaf af_pan.c,1.6,1.7

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Sep 15 13:41:26 CEST 2005


CVS change done by Reimar Döffinger CVS

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

Modified Files:
	af_pan.c 
Log Message:
Fix af_pan commandline mess and (hopefully) improve description.
It should now output the right number of channels and it doesn't silently
clamp values to the too restrictive [0, 1] range.


Index: af_pan.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_pan.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- af_pan.c	8 Jan 2005 21:34:06 -0000	1.6
+++ af_pan.c	15 Sep 2005 11:41:23 -0000	1.7
@@ -64,10 +64,9 @@
     cp = &((char*)arg)[n];
     j = 0; k = 0;
     while((*cp == ':') && (k < AF_NCH)){
-      sscanf(cp, ":%f%n" , &s->level[k][j], &n);
-      s->level[k][j] = clamp(s->level[k][j],0.0,1.0);
+      sscanf(cp, ":%f%n" , &s->level[j][k], &n);
       af_msg(AF_MSG_VERBOSE,"[pan] Pan level from channel %i to" 
-	     " channel %i = %f\n",j,k,s->level[k][j]);
+	     " channel %i = %f\n",k,j,s->level[j][k]);
       cp =&cp[n];
       j++;
       if(j>=nch){
@@ -81,14 +80,18 @@
     int    i;
     int    ch = ((af_control_ext_t*)arg)->ch;
     float* level = ((af_control_ext_t*)arg)->arg;
+    if (ch >= AF_NCH)
+      return AF_FALSE;
     for(i=0;i<AF_NCH;i++)
-      s->level[ch][i] = clamp(level[i],0.0,1.0);
+      s->level[ch][i] = level[i];
     return AF_OK;
   }
   case AF_CONTROL_PAN_LEVEL | AF_CONTROL_GET:{
     int    i;
     int ch = ((af_control_ext_t*)arg)->ch;
     float* level = ((af_control_ext_t*)arg)->arg;
+    if (ch >= AF_NCH)
+      return AF_FALSE;
     for(i=0;i<AF_NCH;i++)
       level[i] = s->level[ch][i];
     return AF_OK;




More information about the MPlayer-cvslog mailing list