# HG changeset patch # User anders # Date 1042163134 0 # Node ID 398e3fb7c1030d77faf717684034e46cff7f969f # Parent 558f0b1f45ee958d4122df5822f405ee7347e3de 10l bug for float conversion control + feature fix in volume control diff -r 558f0b1f45ee -r 398e3fb7c103 cfg-mplayer.h --- a/cfg-mplayer.h Fri Jan 10 01:01:38 2003 +0000 +++ b/cfg-mplayer.h Fri Jan 10 01:45:34 2003 +0000 @@ -127,7 +127,7 @@ extern af_cfg_t af_cfg; // Audio filter configuration, defined in libmpcodecs/dec_audio.c struct config audio_filter_conf[]={ {"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, + {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; diff -r 558f0b1f45ee -r 398e3fb7c103 libaf/af.h --- a/libaf/af.h Fri Jan 10 01:01:38 2003 +0000 +++ b/libaf/af.h Fri Jan 10 01:45:34 2003 +0000 @@ -70,8 +70,8 @@ #define AF_INIT_TYPE_MASK 0x00000003 #define AF_INIT_INT 0x00000000 -#define AF_INIT_FLOAT 0x00000010 -#define AF_INIT_FORMAT_MASK 0x00000010 +#define AF_INIT_FLOAT 0x00000004 +#define AF_INIT_FORMAT_MASK 0x00000004 // Default init type #ifndef AF_INIT_TYPE diff -r 558f0b1f45ee -r 398e3fb7c103 libaf/af_resample.c --- a/libaf/af_resample.c Fri Jan 10 01:01:38 2003 +0000 +++ b/libaf/af_resample.c Fri Jan 10 01:45:34 2003 +0000 @@ -279,14 +279,14 @@ int rate=0; int type=RSMP_INT; int sloppy=1; - sscanf((char*)arg,"%i:%i:%i", &rate, &type, &sloppy); + sscanf((char*)arg,"%i:%i:%i", &rate, &sloppy, &type); s->setup = (sloppy?FREQ_SLOPPY:FREQ_EXACT) | (clamp(type,RSMP_LIN,RSMP_FLOAT)); return af->control(af,AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET, &rate); } case AF_CONTROL_POST_CREATE: if((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT) - ((af_resample_t*)af->setup)->setup |= RSMP_FLOAT; + ((af_resample_t*)af->setup)->setup = RSMP_FLOAT; return AF_OK; case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET: // Reinit must be called after this function has been called diff -r 558f0b1f45ee -r 398e3fb7c103 libaf/af_volume.c --- a/libaf/af_volume.c Fri Jan 10 01:01:38 2003 +0000 +++ b/libaf/af_volume.c Fri Jan 10 01:45:34 2003 +0000 @@ -83,8 +83,8 @@ return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol); } case AF_CONTROL_POST_CREATE: - s->fast = (((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == - AF_INIT_FLOAT ? 1 : 0; + s->fast = ((((af_cfg_t*)arg)->force & AF_INIT_FORMAT_MASK) == + AF_INIT_FLOAT) ? 0 : 1; return AF_OK; case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_SET: memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int)); @@ -109,9 +109,12 @@ case AF_CONTROL_PRE_DESTROY:{ float m = 0.0; int i; - for(i=0;imax[i]); - af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m)); + if(!s->fast){ + for(i=0;imax[i]); + af_msg(AF_MSG_INFO,"[volume] The maximum volume was %0.2fdB \n", + 10*log10(m)); + } return AF_OK; } }