mirror of
https://github.com/mpv-player/mpv
synced 2025-02-25 17:58:27 +00:00
Printing of max volume on exit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8187 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cce460d88b
commit
3678657416
@ -59,7 +59,7 @@ inline int from_dB(float* in, float* out, float k)
|
|||||||
if(in[i]<MIN_VOL)
|
if(in[i]<MIN_VOL)
|
||||||
out[i]=0.0;
|
out[i]=0.0;
|
||||||
else
|
else
|
||||||
out[i]=pow(10.0,clamp(in[i],MIN_VOL,MAX_VOL)/k);
|
out[i]=pow(10.0,clamp(in[i],MIN_VOL,MAX_VOL)/k);
|
||||||
}
|
}
|
||||||
return AF_OK;
|
return AF_OK;
|
||||||
}
|
}
|
||||||
@ -131,6 +131,14 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
|
|||||||
case AF_CONTROL_VOLUME_ON_OFF:
|
case AF_CONTROL_VOLUME_ON_OFF:
|
||||||
s->onoff = (int)arg;
|
s->onoff = (int)arg;
|
||||||
return AF_OK;
|
return AF_OK;
|
||||||
|
case AF_CONTROL_PRE_DESTROY:{
|
||||||
|
float m = 0.0;
|
||||||
|
int i;
|
||||||
|
for(i=0;i<NCH;i++)
|
||||||
|
m=max(m,s->maxpower[i]);
|
||||||
|
af_msg(AF_MSG_INFO,"The maximum volume was %0.2fdB \n",10*log10(m));
|
||||||
|
return AF_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AF_UNKNOWN;
|
return AF_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user