diff options
author | Max Kellermann <max@duempel.org> | 2010-02-15 19:09:09 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-02-15 19:09:09 +0100 |
commit | f4e9275f7c2f6b304aa3b2d3c83ee4ad1cf6ed95 (patch) | |
tree | 2f903ba43671b4038b864f9bd8c1db38ff938de2 | |
parent | f6726573881b66c28066cd77cb1447d0b42d0740 (diff) | |
download | mpd-f4e9275f7c2f6b304aa3b2d3c83ee4ad1cf6ed95.tar.gz mpd-f4e9275f7c2f6b304aa3b2d3c83ee4ad1cf6ed95.tar.xz mpd-f4e9275f7c2f6b304aa3b2d3c83ee4ad1cf6ed95.zip |
filter/volume: assign dest_size_r early, eliminate one
-rw-r--r-- | src/filter/volume_filter_plugin.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/filter/volume_filter_plugin.c b/src/filter/volume_filter_plugin.c index eca7841da..42311ca5e 100644 --- a/src/filter/volume_filter_plugin.c +++ b/src/filter/volume_filter_plugin.c @@ -98,14 +98,13 @@ volume_filter_filter(struct filter *_filter, const void *src, size_t src_size, bool success; void *dest; - if (filter->volume >= PCM_VOLUME_1) { + *dest_size_r = src_size; + + if (filter->volume >= PCM_VOLUME_1) /* optimized special case: 100% volume = no-op */ - *dest_size_r = src_size; return src; - } dest = pcm_buffer_get(&filter->buffer, src_size); - *dest_size_r = src_size; if (filter->volume <= 0) { /* optimized special case: 0% volume = memset(0) */ |