diff options
-rw-r--r-- | cfg-mplayer.h | 2 | ||||
-rw-r--r-- | libaf/af.h | 4 | ||||
-rw-r--r-- | libaf/af_resample.c | 4 | ||||
-rw-r--r-- | libaf/af_volume.c | 13 |
4 files changed, 13 insertions, 10 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 06baf818c3..45a6ccb522 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -127,7 +127,7 @@ extern float monitor_aspect; 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 --git a/libaf/af.h b/libaf/af.h index 3ac9d4cacf..4fbb54291a 100644 --- a/libaf/af.h +++ b/libaf/af.h @@ -70,8 +70,8 @@ extern int* af_cpu_speed; #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 --git a/libaf/af_resample.c b/libaf/af_resample.c index 5c932fb3b3..06b224c983 100644 --- a/libaf/af_resample.c +++ b/libaf/af_resample.c @@ -279,14 +279,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg) 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 --git a/libaf/af_volume.c b/libaf/af_volume.c index 4fc6905f4e..e0ad6d0faa 100644 --- a/libaf/af_volume.c +++ b/libaf/af_volume.c @@ -83,8 +83,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg) 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 @@ static int control(struct af_instance_s* af, int cmd, void* arg) case AF_CONTROL_PRE_DESTROY:{ float m = 0.0; int i; - for(i=0;i<AF_NCH;i++) - m=max(m,s->max[i]); - af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m)); + if(!s->fast){ + for(i=0;i<AF_NCH;i++) + m=max(m,s->max[i]); + af_msg(AF_MSG_INFO,"[volume] The maximum volume was %0.2fdB \n", + 10*log10(m)); + } return AF_OK; } } |