diff options
author | wm4 <wm4@nowhere> | 2013-10-26 12:56:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-26 13:36:34 +0200 |
commit | b890093c449313068eaee163760702dcf5e65acd (patch) | |
tree | 6ce7920984e8db3259b08be2c028fe19e918ce20 /audio/filter/af_volume.c | |
parent | 3b5657f0c156def89ae30cc73333eb2c2feddd39 (diff) | |
download | mpv-b890093c449313068eaee163760702dcf5e65acd.tar.bz2 mpv-b890093c449313068eaee163760702dcf5e65acd.tar.xz |
af_volume: don't change volume if nothing is to be changed
On the float path. Note that this skips clipping, but we expect that
everything on the audio-path is pre-clipped anyway.
Diffstat (limited to 'audio/filter/af_volume.c')
-rw-r--r-- | audio/filter/af_volume.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/filter/af_volume.c b/audio/filter/af_volume.c index 4b55dd574f..876b1136ce 100644 --- a/audio/filter/af_volume.c +++ b/audio/filter/af_volume.c @@ -112,6 +112,7 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data) int len = c->len/4; // Number of samples for (int ch = 0; ch < nch; ch++) { // Volume control (fader) + if (s->level[ch] != 1.0) { for(i=ch;i<len;i+=nch){ register float x = a[i]; // Set volume @@ -125,6 +126,7 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data) x=clamp(x,-1.0,1.0); a[i] = x; } + } } } return c; |