summaryrefslogtreecommitdiff
path: root/src/post
diff options
context:
space:
mode:
Diffstat (limited to 'src/post')
-rw-r--r--src/post/audio/Makefile.am1
-rw-r--r--src/post/audio/audio_filters.c3
-rw-r--r--src/post/audio/filter.c2
-rw-r--r--src/post/audio/filter.h2
-rw-r--r--src/post/audio/stretch.c10
-rw-r--r--src/post/audio/upmix.c8
-rw-r--r--src/post/audio/upmix_mono.c38
-rw-r--r--src/post/audio/volnorm.c14
-rw-r--r--src/post/deinterlace/Makefile.am3
-rw-r--r--src/post/deinterlace/plugins/Makefile.am6
-rw-r--r--src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h2
-rw-r--r--src/post/deinterlace/tvtime.c14
-rw-r--r--src/post/deinterlace/tvtime.h5
-rw-r--r--src/post/deinterlace/xine_plugin.c17
-rw-r--r--src/post/goom/Makefile.am1
-rw-r--r--src/post/goom/convolve_fx.c4
-rw-r--r--src/post/goom/diff_against_release.patch37
-rw-r--r--src/post/goom/goom_core.c12
-rw-r--r--src/post/goom/ppc_zoom_ultimate.h2
-rw-r--r--src/post/goom/xine_goom.c6
-rw-r--r--src/post/mosaico/Makefile.am1
-rw-r--r--src/post/mosaico/mosaico.c13
-rw-r--r--src/post/mosaico/switch.c4
-rw-r--r--src/post/planar/Makefile.am5
-rw-r--r--src/post/planar/boxblur.c6
-rw-r--r--src/post/planar/denoise3d.c6
-rw-r--r--src/post/planar/eq.c6
-rw-r--r--src/post/planar/eq2.c37
-rw-r--r--src/post/planar/expand.c2
-rw-r--r--src/post/planar/fill.c2
-rw-r--r--src/post/planar/invert.c2
-rw-r--r--src/post/planar/noise.c6
-rw-r--r--src/post/planar/planar.c4
-rw-r--r--src/post/planar/pp.c22
-rw-r--r--src/post/planar/unsharp.c13
-rw-r--r--src/post/visualizations/Makefile.am1
-rw-r--r--src/post/visualizations/fftgraph.c6
-rw-r--r--src/post/visualizations/fftscope.c6
-rw-r--r--src/post/visualizations/fooviz.c6
-rw-r--r--src/post/visualizations/oscope.c6
40 files changed, 224 insertions, 117 deletions
diff --git a/src/post/audio/Makefile.am b/src/post/audio/Makefile.am
index 41a364d0d..5e587ef2f 100644
--- a/src/post/audio/Makefile.am
+++ b/src/post/audio/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
noinst_HEADERS = dsp.h filter.h window.h audio_filters.h
diff --git a/src/post/audio/audio_filters.c b/src/post/audio/audio_filters.c
index 8200db51b..12d48784c 100644
--- a/src/post/audio/audio_filters.c
+++ b/src/post/audio/audio_filters.c
@@ -20,6 +20,9 @@
* catalog for audio filter plugins
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "xine_internal.h"
#include "xineutils.h"
diff --git a/src/post/audio/filter.c b/src/post/audio/filter.c
index c5602736c..55d75e1e4 100644
--- a/src/post/audio/filter.c
+++ b/src/post/audio/filter.c
@@ -414,7 +414,7 @@ void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef
*
* return -1 if fail 0 if success.
*/
-int szxform(_ftype_t* a, _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef)
+int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef)
{
_ftype_t at[3];
_ftype_t bt[3];
diff --git a/src/post/audio/filter.h b/src/post/audio/filter.h
index 0b0ce1c1b..0e08aa2b9 100644
--- a/src/post/audio/filter.h
+++ b/src/post/audio/filter.h
@@ -55,7 +55,7 @@ extern int design_pfir(unsigned int n, unsigned int k, _ftype_t* w, _ftype_t** p
extern void prewarp(_ftype_t* a, _ftype_t fc, _ftype_t fs);
void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef);
-extern int szxform(_ftype_t* a, _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef);
+extern int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftype_t fs, _ftype_t *k, _ftype_t *coef);
/* Add new data to circular queue designed to be used with a FIR
* filter. xq is the circular queue, in pointing at the new sample, xi
diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c
index 5aa7a0617..d4621a800 100644
--- a/src/post/audio/stretch.c
+++ b/src/post/audio/stretch.c
@@ -20,6 +20,10 @@
* Time stretch by a given factor, optionally preserving pitch
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include "xine_internal.h"
@@ -152,10 +156,10 @@ static void stretchscr_exit (scr_plugin_t *scr) {
free(this);
}
-static stretchscr_t* stretchscr_init (double *stretch_factor) {
+static stretchscr_t *XINE_MALLOC stretchscr_init (double *stretch_factor) {
stretchscr_t *this;
- this = (stretchscr_t *) xine_xmalloc(sizeof(stretchscr_t));
+ this = calloc(1, sizeof(stretchscr_t));
this->scr.interface_version = 3;
this->scr.get_priority = stretchscr_get_priority;
@@ -620,7 +624,7 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_stretch_t *this = (post_plugin_stretch_t *)xine_xmalloc(sizeof(post_plugin_stretch_t));
+ post_plugin_stretch_t *this = calloc(1, sizeof(post_plugin_stretch_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index e1b2afbe3..e753f4a2a 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.c
@@ -24,6 +24,10 @@
* E.g. Converts Stereo into Surround 5.1
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include "xine_internal.h"
@@ -181,7 +185,7 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
}
pthread_mutex_lock (&this->lock);
- this->sub = xine_xmalloc(sizeof(af_sub_t));
+ this->sub = calloc(1, sizeof(af_sub_t));
if (!this->sub) {
pthread_mutex_unlock (&this->lock);
return 0;
@@ -379,7 +383,7 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_upmix_t *this = (post_plugin_upmix_t *)xine_xmalloc(sizeof(post_plugin_upmix_t));
+ post_plugin_upmix_t *this = calloc(1, sizeof(post_plugin_upmix_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c
index 195831123..52b5f497b 100644
--- a/src/post/audio/upmix_mono.c
+++ b/src/post/audio/upmix_mono.c
@@ -23,6 +23,10 @@
* It simply converts Mono into Stereo.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#define LOG_MODULE "upmix_mono"
@@ -192,32 +196,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 +248,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 +263,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;
}
@@ -293,7 +297,7 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_upmix_mono_t *this = (post_plugin_upmix_mono_t *)xine_xmalloc(sizeof(post_plugin_upmix_mono_t));
+ post_plugin_upmix_mono_t *this = calloc(1, sizeof(post_plugin_upmix_mono_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c
index 783c1e26d..158705ef7 100644
--- a/src/post/audio/volnorm.c
+++ b/src/post/audio/volnorm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2005 the xine project
+ * Copyright (C) 2000-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -22,6 +22,10 @@
* & Pierre Lombard.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <math.h>
@@ -407,12 +411,11 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_volnorm_t *this = (post_plugin_volnorm_t *)xine_xmalloc(sizeof(post_plugin_volnorm_t));
+ post_plugin_volnorm_t *this = calloc(1, sizeof(post_plugin_volnorm_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
post_audio_port_t *port;
- int i;
if (!this || !audio_target || !audio_target[0] ) {
free(this);
@@ -426,9 +429,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/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am
index d382a2e98..bac6bac33 100644
--- a/src/post/deinterlace/Makefile.am
+++ b/src/post/deinterlace/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
SUBDIRS = plugins
@@ -8,7 +9,7 @@ xinepost_LTLIBRARIES = xineplug_post_tvtime.la
xineplug_post_tvtime_la_SOURCES = xine_plugin.c \
deinterlace.c pulldown.c speedy.c tvtime.c
-xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) \
+xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(PTHREAD_LIBS) \
$(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la
xineplug_post_tvtime_la_CFLAGS = $(VISIBILITY_FLAG)
diff --git a/src/post/deinterlace/plugins/Makefile.am b/src/post/deinterlace/plugins/Makefile.am
index 17d170127..5f0997eb8 100644
--- a/src/post/deinterlace/plugins/Makefile.am
+++ b/src/post/deinterlace/plugins/Makefile.am
@@ -30,7 +30,10 @@ EXTRA_DIST = greedy2frame_template.c greedyh.asm \
# libpostproc is here so we can use their nice mangle.h
AM_CFLAGS = -I$(top_srcdir)/src/post/deinterlace \
- -I$(top_srcdir)/src/libffmpeg/libavcodec/libpostproc
+ -I$(top_srcdir)/src/xine-utils
+
+# Avoid "can't find register" failures with -O0, -O2, -O3 (gcc 4.0)
+libdeinterlaceplugins_la-kdetv_greedyh.o libdeinterlaceplugins_la-kdetv_greedyh.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/$$/ -O1/')
noinst_LTLIBRARIES = libdeinterlaceplugins.la
@@ -45,7 +48,6 @@ libdeinterlaceplugins_la_SOURCES = \
scalerbob.c \
kdetv_greedyh.c \
kdetv_tomsmocomp.c
-libdeinterlaceplugins_la_LIBADD = $(XINE_LIB)
libdeinterlaceplugins_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
libdeinterlaceplugins_la_LDFLAGS = -avoid-version -module
diff --git a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
index a3b92a51c..a0136fd44 100644
--- a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
+++ b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
@@ -2,6 +2,8 @@
#include <math.h>
#include <stdlib.h>
+#include "mangle.h"
+
#define USE_FOR_DSCALER
#define MyMemCopy xine_fast_memcpy
diff --git a/src/post/deinterlace/tvtime.c b/src/post/deinterlace/tvtime.c
index eff43d5e8..97da6543e 100644
--- a/src/post/deinterlace/tvtime.c
+++ b/src/post/deinterlace/tvtime.c
@@ -38,14 +38,6 @@
#include "tvtime.h"
/**
- * This is how many frames to wait until deciding if the pulldown phase
- * has changed or if we've really found a pulldown sequence. This is
- * currently set to about 1 second, that is, we won't go into film mode
- * until we've seen a pulldown sequence successfully for 1 second.
- */
-#define PULLDOWN_ERROR_WAIT 60
-
-/**
* This is how many predictions have to be incorrect before we fall back to
* video mode. Right now, if we mess up, we jump to video mode immediately.
*/
@@ -192,13 +184,13 @@ int tvtime_build_deinterlaced_frame( tvtime_t *tvtime, uint8_t *output,
if( !tvtime->pdoffset ) {
/* No pulldown offset applies, drop out of pulldown immediately. */
tvtime->pdlastbusted = 0;
- tvtime->pderror = PULLDOWN_ERROR_WAIT;
+ tvtime->pderror = tvtime->pulldown_error_wait;
} else if( tvtime->pdoffset != predicted ) {
if( tvtime->pdlastbusted ) {
tvtime->pdlastbusted--;
tvtime->pdoffset = predicted;
} else {
- tvtime->pderror = PULLDOWN_ERROR_WAIT;
+ tvtime->pderror = tvtime->pulldown_error_wait;
}
} else {
if( tvtime->pderror ) {
@@ -437,7 +429,7 @@ void tvtime_reset_context( tvtime_t *tvtime )
tvtime->last_botdiff = 0;
tvtime->pdoffset = PULLDOWN_SEQ_AA;
- tvtime->pderror = PULLDOWN_ERROR_WAIT;
+ tvtime->pderror = tvtime->pulldown_error_wait;
tvtime->pdlastbusted = 0;
tvtime->filmmode = 0;
}
diff --git a/src/post/deinterlace/tvtime.h b/src/post/deinterlace/tvtime.h
index 8e4c5abc2..2253f264e 100644
--- a/src/post/deinterlace/tvtime.h
+++ b/src/post/deinterlace/tvtime.h
@@ -56,6 +56,11 @@ typedef struct {
*/
deinterlace_method_t *curmethod;
+ /**
+ * This is how many frames to wait until deciding if the pulldown phase
+ * has changed or if we've really found a pulldown sequence.
+ */
+ unsigned int pulldown_error_wait;
/* internal data */
int last_topdiff;
diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c
index 477e6812b..7149f2bdb 100644
--- a/src/post/deinterlace/xine_plugin.c
+++ b/src/post/deinterlace/xine_plugin.c
@@ -23,6 +23,10 @@
* heavily based on tvtime.sf.net by Billy Biggs
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
#define LOG
*/
@@ -69,6 +73,7 @@ typedef struct deinterlace_parameters_s {
int method;
int enabled;
int pulldown;
+ int pulldown_error_wait;
int framerate_mode;
int judder_correction;
int use_progressive_frame_flag;
@@ -87,6 +92,8 @@ PARAM_ITEM( POST_PARAM_TYPE_BOOL, enabled, NULL, 0, 1, 0,
"enable/disable" )
PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown, enum_pulldown, 0, 0, 0,
"pulldown algorithm" )
+PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown_error_wait, NULL, 0, 0, 0,
+ "number of frames of telecine pattern sync required before mode change" )
PARAM_ITEM( POST_PARAM_TYPE_INT, framerate_mode, enum_framerate, 0, 0, 0,
"framerate output mode" )
PARAM_ITEM( POST_PARAM_TYPE_BOOL, judder_correction, NULL, 0, 1, 0,
@@ -165,6 +172,7 @@ static int set_parameters (xine_post_t *this_gen, void *param_gen) {
this->enabled = param->enabled;
this->pulldown = param->pulldown;
+ this->tvtime->pulldown_error_wait = param->pulldown_error_wait;
this->framerate_mode = param->framerate_mode;
this->judder_correction = param->judder_correction;
this->use_progressive_frame_flag = param->use_progressive_frame_flag;
@@ -185,6 +193,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
param->method = this->cur_method;
param->enabled = this->enabled;
param->pulldown = this->pulldown;
+ param->pulldown_error_wait = this->tvtime->pulldown_error_wait;
param->framerate_mode = this->framerate_mode;
param->judder_correction = this->judder_correction;
param->use_progressive_frame_flag = this->use_progressive_frame_flag;
@@ -212,6 +221,9 @@ static char * get_static_help (void) {
"\n"
" Enabled: Enable/disable the plugin.\n"
"\n"
+ " Pulldown_error_wait: Ensures that the telecine pattern has been "
+ "locked for this many frames before changing to filmmode.\n"
+ "\n"
" Pulldown: Choose the 2-3 pulldown detection algorithm. 24 FPS films "
"that have being converted to NTSC can be detected and intelligently "
"reconstructed to their original (non-interlaced) frames.\n"
@@ -291,7 +303,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
static void *deinterlace_init_plugin(xine_t *xine, void *data)
{
- post_class_deinterlace_t *class = (post_class_deinterlace_t *)xine_xmalloc(sizeof(post_class_deinterlace_t));
+ post_class_deinterlace_t *class = calloc(1, sizeof(post_class_deinterlace_t));
uint32_t config_flags = xine_mm_accel();
int i;
@@ -350,6 +362,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
class->init_param.method = 1; /* First (plugin) method available */
class->init_param.enabled = 1;
class->init_param.pulldown = 1; /* vektor */
+ class->init_param.pulldown_error_wait = 60; /* about one second */
class->init_param.framerate_mode = 0; /* full */
class->init_param.judder_correction = 1;
class->init_param.use_progressive_frame_flag = 1;
@@ -364,7 +377,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)xine_xmalloc(sizeof(post_plugin_deinterlace_t));
+ post_plugin_deinterlace_t *this = calloc(1, sizeof(post_plugin_deinterlace_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/goom/Makefile.am b/src/post/goom/Makefile.am
index c01482917..cd022c9b0 100644
--- a/src/post/goom/Makefile.am
+++ b/src/post/goom/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
EXTRA_DIST = mmx.c xmmx.c ppc_drawings.s ppc_zoom_ultimate.s diff_against_release.patch \
diff --git a/src/post/goom/convolve_fx.c b/src/post/goom/convolve_fx.c
index e86bb3723..ee36dfd0b 100644
--- a/src/post/goom/convolve_fx.c
+++ b/src/post/goom/convolve_fx.c
@@ -20,7 +20,7 @@ typedef char Motif[CONV_MOTIF_W][CONV_MOTIF_W];
#define NB_THETA 512
-#define MAX 2.0f
+//#define MAX 2.0f
typedef struct _CONV_DATA{
PluginParam light;
@@ -73,7 +73,7 @@ static void set_motif(ConvData *data, Motif motif)
static void convolve_init(VisualFX *_this, PluginInfo *info) {
ConvData *data;
- data = (ConvData*)malloc(sizeof(ConvData));
+ data = (ConvData*)calloc(1, sizeof(ConvData));
_this->fx_data = (void*)data;
data->light = secure_f_param("Screen Brightness");
diff --git a/src/post/goom/diff_against_release.patch b/src/post/goom/diff_against_release.patch
index bde85c285..a5e84b8d1 100644
--- a/src/post/goom/diff_against_release.patch
+++ b/src/post/goom/diff_against_release.patch
@@ -653,3 +653,40 @@ diff -u -p -r1.2 -r1.3
#endif
+diff -r 96c7f8460d61 src/post/goom/convolve_fx.c
+--- convolve_fx.c Mon Nov 10 16:33:51 2008 +0100
++++ convolve_fx.c Sun Nov 16 21:14:29 2008 +0100
+@@ -73,7 +73,7 @@ static void set_motif(ConvData *data, Mo
+
+ static void convolve_init(VisualFX *_this, PluginInfo *info) {
+ ConvData *data;
+- data = (ConvData*)malloc(sizeof(ConvData));
++ data = (ConvData*)calloc(1, sizeof(ConvData));
+ _this->fx_data = (void*)data;
+
+ data->light = secure_f_param("Screen Brightness");
+diff -r 96c7f8460d61 src/post/goom/goom_core.c
+--- goom_core.c Mon Nov 10 16:33:51 2008 +0100
++++ goom_core.c Sun Nov 16 21:14:29 2008 +0100
+@@ -76,6 +76,10 @@ PluginInfo *goom_init (guint32 resx, gui
+ goomInfo->tentacles_fx = tentacle_fx_create();
+ goomInfo->tentacles_fx.init(&goomInfo->tentacles_fx, goomInfo);
+
++ goomInfo->screen.width = resx;
++ goomInfo->screen.height = resy;
++ goomInfo->screen.size = resx * resy;
++
+ goomInfo->convolve_fx = convolve_create();
+ goomInfo->convolve_fx.init(&goomInfo->convolve_fx, goomInfo);
+
+@@ -83,10 +87,6 @@ PluginInfo *goom_init (guint32 resx, gui
+ plugin_info_add_visual (goomInfo, 1, &goomInfo->tentacles_fx);
+ plugin_info_add_visual (goomInfo, 2, &goomInfo->star_fx);
+ plugin_info_add_visual (goomInfo, 3, &goomInfo->convolve_fx);
+-
+- goomInfo->screen.width = resx;
+- goomInfo->screen.height = resy;
+- goomInfo->screen.size = resx * resy;
+
+ init_buffers(goomInfo, goomInfo->screen.size);
+ goomInfo->gRandom = goom_random_init((uintptr_t)goomInfo->pixel);
diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c
index b24f2f496..62d9a27b6 100644
--- a/src/post/goom/goom_core.c
+++ b/src/post/goom/goom_core.c
@@ -76,6 +76,10 @@ PluginInfo *goom_init (guint32 resx, guint32 resy)
goomInfo->tentacles_fx = tentacle_fx_create();
goomInfo->tentacles_fx.init(&goomInfo->tentacles_fx, goomInfo);
+ goomInfo->screen.width = resx;
+ goomInfo->screen.height = resy;
+ goomInfo->screen.size = resx * resy;
+
goomInfo->convolve_fx = convolve_create();
goomInfo->convolve_fx.init(&goomInfo->convolve_fx, goomInfo);
@@ -84,10 +88,6 @@ PluginInfo *goom_init (guint32 resx, guint32 resy)
plugin_info_add_visual (goomInfo, 2, &goomInfo->star_fx);
plugin_info_add_visual (goomInfo, 3, &goomInfo->convolve_fx);
- goomInfo->screen.width = resx;
- goomInfo->screen.height = resy;
- goomInfo->screen.size = resx * resy;
-
init_buffers(goomInfo, goomInfo->screen.size);
goomInfo->gRandom = goom_random_init((uintptr_t)goomInfo->pixel);
@@ -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/goom/ppc_zoom_ultimate.h b/src/post/goom/ppc_zoom_ultimate.h
index d6932e7e6..d070071c9 100644
--- a/src/post/goom/ppc_zoom_ultimate.h
+++ b/src/post/goom/ppc_zoom_ultimate.h
@@ -11,4 +11,4 @@
void ppc_zoom_generic (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]);
/* G4 Specific PowerPC Code (Possible use of Altivec and Data Streams) */
-void ppc_zoom_G4 (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); \ No newline at end of file
+void ppc_zoom_G4 (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]);
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c
index 8cd06dbd6..db7079423 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.c
@@ -48,7 +48,7 @@
#define GOOM_HEIGHT 240
/* colorspace conversion methods */
-static const char const * goom_csc_methods[]={
+static const char* goom_csc_methods[]={
"Fast but not photorealistic",
"Slow but looks better",
NULL
@@ -187,7 +187,7 @@ static void csc_method_changed_cb(void *data, xine_cfg_entry_t *cfg) {
static void *goom_init_plugin(xine_t *xine, void *data)
{
- post_class_goom_t *this = (post_class_goom_t *)xine_xmalloc(sizeof(post_class_goom_t));
+ post_class_goom_t *this = calloc(1, sizeof(post_class_goom_t));
config_values_t *cfg;
if (!this)
@@ -234,7 +234,7 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_goom_t *this = (post_plugin_goom_t *)xine_xmalloc(sizeof(post_plugin_goom_t));
+ post_plugin_goom_t *this = calloc(1, sizeof(post_plugin_goom_t));
post_class_goom_t *class = (post_class_goom_t*) class_gen;
post_in_t *input;
post_out_t *output;
diff --git a/src/post/mosaico/Makefile.am b/src/post/mosaico/Makefile.am
index af027b6e6..56426c711 100644
--- a/src/post/mosaico/Makefile.am
+++ b/src/post/mosaico/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
xinepost_LTLIBRARIES = xineplug_post_mosaico.la xineplug_post_switch.la
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index 50b1cfcdf..c9ac9ab4c 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
/*
@@ -122,7 +126,7 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream);
static void *mosaico_init_plugin(xine_t *xine, void *data)
{
- post_class_mosaico_t *this = (post_class_mosaico_t *)xine_xmalloc(sizeof(post_class_mosaico_t));
+ post_class_mosaico_t *this = calloc(1, sizeof(post_class_mosaico_t));
if (!this)
return NULL;
@@ -140,7 +144,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_mosaico_t *this = (post_mosaico_t *)xine_xmalloc(sizeof(post_mosaico_t));
+ post_mosaico_t *this = calloc(1, sizeof(post_mosaico_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
@@ -158,7 +162,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
_x_post_init(&this->post, 0, inputs);
- this->pip = (mosaico_pip_t *)xine_xmalloc(sizeof(mosaico_pip_t) * (inputs - 1));
+ this->pip = (mosaico_pip_t *)calloc((inputs - 1), sizeof(mosaico_pip_t));
this->pip_count = inputs - 1;
pthread_cond_init(&this->vpts_limit_changed, NULL);
@@ -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 *)xine_xmalloc(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/mosaico/switch.c b/src/post/mosaico/switch.c
index 8fec5ee77..a01c821b2 100644
--- a/src/post/mosaico/switch.c
+++ b/src/post/mosaico/switch.c
@@ -101,7 +101,7 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream);
static void *switch_init_plugin(xine_t *xine, void *data)
{
- post_class_switch_t *this = (post_class_switch_t *)xine_xmalloc(sizeof(post_class_switch_t));
+ post_class_switch_t *this = calloc(1, sizeof(post_class_switch_t));
if (!this)
return NULL;
@@ -119,7 +119,7 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_switch_t *this = (post_switch_t *)xine_xmalloc(sizeof(post_switch_t));
+ post_switch_t *this = calloc(1, sizeof(post_switch_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am
index 4ba6bfa41..751ea390a 100644
--- a/src/post/planar/Makefile.am
+++ b/src/post/planar/Makefile.am
@@ -1,12 +1,13 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
POSTPROC_INT_LIB = $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
if HAVE_FFMPEG
postproc_lib = $(FFMPEG_POSTPROC_LIBS)
-ff_cflags = $(FFMPEG_POSTPROC_CFLAGS)
+ff_cflags = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
else
-ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec/libpostproc
+ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec
postproc_lib = $(POSTPROC_INT_LIB)
postproc_dep = $(postproc_lib)
endif
diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c
index b7a6f524f..517cec489 100644
--- a/src/post/planar/boxblur.c
+++ b/src/post/planar/boxblur.c
@@ -21,6 +21,10 @@
* Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -154,7 +158,7 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)xine_xmalloc(sizeof(post_plugin_boxblur_t));
+ post_plugin_boxblur_t *this = calloc(1, sizeof(post_plugin_boxblur_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c
index fb3c1102b..21b58dbf9 100644
--- a/src/post/planar/denoise3d.c
+++ b/src/post/planar/denoise3d.c
@@ -21,6 +21,10 @@
* Copyright (C) 2003 Daniel Moreno <comac@comac.darktech.org>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -194,7 +198,7 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)xine_xmalloc(sizeof(post_plugin_denoise3d_t));
+ post_plugin_denoise3d_t *this = calloc(1, sizeof(post_plugin_denoise3d_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c
index b2cf6e50f..45bc43463 100644
--- a/src/post/planar/eq.c
+++ b/src/post/planar/eq.c
@@ -21,6 +21,10 @@
* Copyright (C) Richard Felker
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -246,7 +250,7 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_eq_t *this = (post_plugin_eq_t *)xine_xmalloc(sizeof(post_plugin_eq_t));
+ post_plugin_eq_t *this = calloc(1, sizeof(post_plugin_eq_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 6b277c347..1a301fdab 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2006 the xine project
+ * Copyright (C) 2000-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -25,6 +25,10 @@
* Richard Felker (original MMX contrast/brightness code (vf_eq.c))
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -427,13 +431,11 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_eq2_t *this = (post_plugin_eq2_t *)xine_xmalloc(sizeof(post_plugin_eq2_t));
+ post_plugin_eq2_t *this = calloc(1, sizeof(post_plugin_eq2_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
- vf_eq2_t *eq2;
- int i;
if (!this || !video_target || !video_target[0]) {
free(this);
@@ -442,26 +444,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;
- }
+ memset(&this->eq2, 0, sizeof(this->eq2));
- 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;
+ 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/expand.c b/src/post/planar/expand.c
index 67d449153..52bc2b37a 100644
--- a/src/post/planar/expand.c
+++ b/src/post/planar/expand.c
@@ -148,7 +148,7 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_expand_t *this = (post_expand_t *)xine_xmalloc(sizeof(post_expand_t));
+ post_expand_t *this = calloc(1, sizeof(post_expand_t));
post_in_t *input;
xine_post_in_t *input_param;
post_out_t *output;
diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c
index 32a9d5dfb..98c572777 100644
--- a/src/post/planar/fill.c
+++ b/src/post/planar/fill.c
@@ -66,7 +66,7 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c
index 1aa5c2a2e..d1f0c8d4e 100644
--- a/src/post/planar/invert.c
+++ b/src/post/planar/invert.c
@@ -67,7 +67,7 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index 8c04f2e72..f639fce76 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -21,6 +21,10 @@
* is copyright 2002 Michael Niedermayer <michaelni@gmx.at>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -471,7 +475,7 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_noise_t *this = (post_plugin_noise_t *)xine_xmalloc(sizeof(post_plugin_noise_t));
+ post_plugin_noise_t *this = calloc(1, sizeof(post_plugin_noise_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c
index 5907d58e5..e1c9681ab 100644
--- a/src/post/planar/planar.c
+++ b/src/post/planar/planar.c
@@ -20,6 +20,10 @@
* catalog for planar post plugins
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index e13119311..1ce45e381 100644
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
@@ -20,12 +20,21 @@
* plugin for ffmpeg libpostprocess
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
-#include "postprocess.h"
#include <pthread.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <postprocess.h>
+#else
+# include <libpostproc/postprocess.h>
+#endif
+
#define PP_STRING_SIZE 256 /* size of pp mode string (including all options) */
/* plugin class initialization function */
@@ -114,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;
}
@@ -169,7 +175,7 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_pp_t *this = (post_plugin_pp_t *)xine_xmalloc(sizeof(post_plugin_pp_t));
+ post_plugin_pp_t *this = calloc(1, sizeof(post_plugin_pp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c
index b9b791a8e..6fac727ce 100644
--- a/src/post/planar/unsharp.c
+++ b/src/post/planar/unsharp.c
@@ -21,18 +21,15 @@
* Copyright (C) 2002 Rémi Guyomarch <rguyom@pobox.com>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
#include <pthread.h>
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
/*===========================================================================*/
#define MIN_MATRIX_SIZE 3
@@ -287,7 +284,7 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_unsharp_t *this = (post_plugin_unsharp_t *)xine_xmalloc(sizeof(post_plugin_unsharp_t));
+ post_plugin_unsharp_t *this = calloc(1, sizeof(post_plugin_unsharp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/visualizations/Makefile.am b/src/post/visualizations/Makefile.am
index f42598d9c..a766bc10a 100644
--- a/src/post/visualizations/Makefile.am
+++ b/src/post/visualizations/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
EXTRA_DIST = fooviz.c
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index 5068bd37a..8bd30ed5c 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -21,6 +21,10 @@
* by Thibaut Mattern (tmattern@noos.fr)
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <math.h>
@@ -415,7 +419,7 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_fftgraph_t *class = (post_class_fftgraph_t *)class_gen;
- post_plugin_fftgraph_t *this = (post_plugin_fftgraph_t *)xine_xmalloc(sizeof(post_plugin_fftgraph_t));
+ post_plugin_fftgraph_t *this = calloc(1, sizeof(post_plugin_fftgraph_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index ba34437f5..ccff59634 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -23,6 +23,10 @@
* FFT code by Steve Haehnichen, originally licensed under GPL v1
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <math.h>
@@ -435,7 +439,7 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_fftscope_t *this = (post_plugin_fftscope_t *)xine_xmalloc(sizeof(post_plugin_fftscope_t));
+ post_plugin_fftscope_t *this = calloc(1, sizeof(post_plugin_fftscope_t));
post_class_fftscope_t *class = (post_class_fftscope_t *)class_gen;
post_in_t *input;
post_out_t *output;
diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c
index 21854afc6..c645601fc 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.c
@@ -24,6 +24,10 @@
* colors on each iteration.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include "xine_internal.h"
@@ -247,7 +251,7 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_fooviz_t *class = (post_class_fooviz_t *)class_gen;
- post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)xine_xmalloc(sizeof(post_plugin_fooviz_t));
+ post_plugin_fooviz_t *this = calloc(1, sizeof(post_plugin_fooviz_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;
diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c
index a435604d4..a2c9c6961 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -21,6 +21,10 @@
* by Mike Melanson (melanson@pcisys.net)
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include "xine_internal.h"
@@ -318,7 +322,7 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_oscope_t *class = (post_class_oscope_t *)class_gen;
- post_plugin_oscope_t *this = (post_plugin_oscope_t *)xine_xmalloc(sizeof(post_plugin_oscope_t));
+ post_plugin_oscope_t *this = calloc(1, sizeof(post_plugin_oscope_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;