diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
commit | 902d66eb8304ccffdb683b7130e9f548011b8d30 (patch) | |
tree | 9cdd73b5f68131ba2d4944d17e183b4313bdb559 /src/post/audio/volnorm.c | |
parent | a51427608e2f4543ae0cb0598517a1e4f6b0928b (diff) | |
download | xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.gz xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.bz2 |
Avoid loop for common memory operations (zeroing, copying, moving).
Use the proper function for common memory operations (memset() for
zeroing, memcpy() for copying, memmove() for moving), instead of
looping through arrays.
By extension, remove loops to reset arrays when they were allocated
with calloc() and thus already zeroed.
Diffstat (limited to 'src/post/audio/volnorm.c')
-rw-r--r-- | src/post/audio/volnorm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 07d06fe1c..4fdb7dbfc 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -426,9 +426,8 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs, this->mul = MUL_INIT; this->lastavg = MID_S16; this->idx = 0; - for (i = 0; i < NSAMPLES; i++) - this->mem[i].len = this->mem[i].avg = 0; - + memset(this->mem, 0, sizeof(this->mem)); + port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output); port->new_port.open = volnorm_port_open; port->new_port.close = volnorm_port_close; |