diff options
Diffstat (limited to 'src/post')
-rw-r--r-- | src/post/audio/upmix_mono.c | 32 | ||||
-rw-r--r-- | src/post/audio/volnorm.c | 5 | ||||
-rw-r--r-- | src/post/goom/goom_core.c | 4 | ||||
-rw-r--r-- | src/post/mosaico/mosaico.c | 7 | ||||
-rw-r--r-- | src/post/planar/eq2.c | 29 | ||||
-rw-r--r-- | src/post/planar/pp.c | 13 |
6 files changed, 41 insertions, 49 deletions
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c index caf99a309..2d3429788 100644 --- a/src/post/audio/upmix_mono.c +++ b/src/post/audio/upmix_mono.c @@ -192,32 +192,32 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, _x_extra_info_merge(buf1->extra_info, buf->extra_info); { - int step = buf->format.bits / 8; + const size_t step = buf->format.bits / 8; uint8_t *src = (uint8_t *)buf->mem; uint8_t *dst0 = (uint8_t *)buf0->mem; uint8_t *dst1 = (uint8_t *)buf1->mem; - int i, k; + int i; for (i = 0; i < buf->num_frames / 2; i++) { - for (k = 0; k < step; k++) - *dst0++ = *src++; + memcpy(dst0, src, step); + dst0 += step; - src -= step; + memcpy(dst0, src, step); + dst0 += step; - for (k = 0; k < step; k++) - *dst0++ = *src++; + src += step; } for (i = buf->num_frames / 2; i < buf->num_frames; i++) { - for (k = 0; k < step; k++) - *dst1++ = *src++; + memcpy(dst1, src, step); + dst1 += step; - src -= step; + memcpy(dst1, src, step); + dst1 += step; - for (k = 0; k < step; k++) - *dst1++ = *src++; + src += step; } } @@ -244,11 +244,11 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, _x_extra_info_merge(buf0->extra_info, buf->extra_info); { - int step = buf->format.bits / 8; + const size_t step = buf->format.bits / 8; uint8_t *src = (uint8_t *)buf->mem; uint8_t *dst0 = (uint8_t *)buf0->mem; int cur_channel = this->params.channel; - int i, j, k; + int i, j; if( cur_channel >= this->channels ) cur_channel = this->channels-1; @@ -259,8 +259,8 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, { for (j = 0; j < this->channels; j++ ) { - for (k = 0; k < step; k++) - *dst0++ = *(src+k); + memcpy(dst0, src, step); + dst0 += step; } src += this->channels * step; } 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; diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c index b24f2f496..35fd7fc35 100644 --- a/src/post/goom/goom_core.c +++ b/src/post/goom/goom_core.c @@ -841,7 +841,7 @@ void update_message (PluginInfo *goomInfo, char *message) { if (message) { int i=1,j=0; - sprintf (goomInfo->update_message.message, "%s", message); + strcpy(goomInfo->update_message.message, message); for (j=0;goomInfo->update_message.message[j];j++) if (goomInfo->update_message.message[j]=='\n') i++; @@ -855,8 +855,8 @@ void update_message (PluginInfo *goomInfo, char *message) { char *ptr = msg; int pos; float ecart; + strncpy(msg, goomInfo->update_message.message, goomInfo->update_message.longueur); message = msg; - sprintf (msg, "%s", goomInfo->update_message.message); while (!fin) { while (1) { diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c index 37551aba5..d99bab43b 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -22,6 +22,10 @@ * simple video mosaico plugin */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #define LOG_MODULE "mosaico" #define LOG_VERBOSE /* @@ -178,8 +182,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, this->pip[i].y = 50; this->pip[i].w = 150; this->pip[i].h = 150; - this->pip[i].input_name = (char *)malloc(sizeof("video in ") + 10); - snprintf(this->pip[i].input_name, sizeof("video in ") + 10, "video in %d", i+1); + asprintf(&(this->pip[i].input_name), "video in %d", i+1); port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL); port->new_port.close = mosaico_close; diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c index 8894b9d06..0ead54f55 100644 --- a/src/post/planar/eq2.c +++ b/src/post/planar/eq2.c @@ -442,26 +442,15 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs, _x_post_init(&this->post, 0, 1); - eq2 = &this->eq2; - for (i = 0; i < 3; i++) { - eq2->buf[i] = NULL; - eq2->buf_w[i] = 0; - eq2->buf_h[i] = 0; - - eq2->param[i].adjust = NULL; - eq2->param[i].c = 1.0; - eq2->param[i].b = 0.0; - eq2->param[i].g = 1.0; - eq2->param[i].lut_clean = 0; - } - - eq2->gamma = this->params.gamma = 1.0; - eq2->contrast = this->params.contrast = 1.0; - eq2->brightness = this->params.brightness = 0.0; - eq2->saturation = this->params.saturation = 1.0; - eq2->rgamma = this->params.rgamma = 1.0; - eq2->ggamma = this->params.ggamma = 1.0; - eq2->bgamma = this->params.bgamma = 1.0; + memset(&this->eq2, 0, sizeof(this->eq2)); + + this->eq2.gamma = this->params.gamma = 1.0; + this->eq2.contrast = this->params.contrast = 1.0; + this->eq2.brightness = this->params.brightness = 0.0; + this->eq2.saturation = this->params.saturation = 1.0; + this->eq2.rgamma = this->params.rgamma = 1.0; + this->eq2.ggamma = this->params.ggamma = 1.0; + this->eq2.bgamma = this->params.bgamma = 1.0; pthread_mutex_init(&this->lock, NULL); diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c index 3c6fe8767..51d28b33d 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -20,6 +20,10 @@ * plugin for ffmpeg libpostprocess */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "xine_internal.h" #include "post.h" #include "xineutils.h" @@ -119,12 +123,9 @@ static char * get_help (void) { ); static char *help = NULL; - if( !help ) { - help = malloc( strlen(help1) + strlen(help2) + strlen(pp_help) + 1); - strcpy(help, help1); - strcat(help, pp_help); - strcat(help, help2); - } + if( !help ) + asprintf(&help, "%s%s%s", help1, help2, pp_help); + return help; } |