summaryrefslogtreecommitdiff
path: root/src/xine-engine/post.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/post.c')
-rw-r--r--src/xine-engine/post.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index 5d8d67037..aa182d627 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -30,13 +30,10 @@
void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs) {
- int audio_inputs_size = (num_audio_inputs + 1) * sizeof(xine_audio_port_t *);
- int video_inputs_size = (num_video_inputs + 1) * sizeof(xine_video_port_t *);
-
post->input = xine_list_new();
post->output = xine_list_new();
- post->xine_post.audio_input = (xine_audio_port_t **)xine_xmalloc(audio_inputs_size);
- post->xine_post.video_input = (xine_video_port_t **)xine_xmalloc(video_inputs_size);
+ post->xine_post.audio_input = calloc(num_audio_inputs + 1, sizeof(xine_audio_port_t *));
+ post->xine_post.video_input = calloc(num_video_inputs + 1, sizeof(xine_video_port_t *));
}
@@ -207,7 +204,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *original,
post_in_t **input, post_out_t **output) {
- post_video_port_t *port = (post_video_port_t *)xine_xmalloc(sizeof(post_video_port_t));
+ post_video_port_t *port = calloc(1, sizeof(post_video_port_t));
if (!port)
return NULL;
@@ -235,7 +232,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
pthread_mutex_init(&port->free_frames_lock, NULL);
if (input) {
- *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t));
+ *input = calloc(1, sizeof(post_in_t));
if (!*input) return port;
(*input)->xine_in.name = "video in";
(*input)->xine_in.type = XINE_POST_DATA_VIDEO;
@@ -245,7 +242,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
}
if (output) {
- *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t));
+ *output = calloc(1, sizeof(post_out_t));
if (!*output) return port;
(*output)->xine_out.name = "video out";
(*output)->xine_out.type = XINE_POST_DATA_VIDEO;
@@ -353,7 +350,7 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *
new_frame = port->free_frame_slots;
port->free_frame_slots = new_frame->next;
} else {
- new_frame = (vo_frame_t *)xine_xmalloc(sizeof(vo_frame_t));
+ new_frame = calloc(1, sizeof(vo_frame_t));
}
pthread_mutex_unlock(&port->free_frames_lock);
@@ -716,7 +713,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *original,
post_in_t **input, post_out_t **output) {
- post_audio_port_t *port = (post_audio_port_t *)xine_xmalloc(sizeof(post_audio_port_t));
+ post_audio_port_t *port = calloc(1, sizeof(post_audio_port_t));
if (!port)
return NULL;
@@ -739,7 +736,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_
pthread_mutex_init(&port->usage_lock, NULL);
if (input) {
- *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t));
+ *input = calloc(1, sizeof(post_in_t));
if (!*input) return port;
(*input)->xine_in.name = "audio in";
(*input)->xine_in.type = XINE_POST_DATA_AUDIO;
@@ -749,7 +746,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_
}
if (output) {
- *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t));
+ *output = calloc(1, sizeof(post_out_t));
if (!*output) return port;
(*output)->xine_out.name = "audio out";
(*output)->xine_out.type = XINE_POST_DATA_AUDIO;