summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xshm.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-12 12:31:40 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-12-12 12:31:40 +0100
commit2e3f351aab6f653313d113f0d2ec0374c2d7aee4 (patch)
treed2243a5002904e2467767cdc92ac54522aa03a93 /src/video_out/video_out_xshm.c
parent3999004c72e12aa3f718ae08c1fec5d50753af65 (diff)
downloadxine-lib-2e3f351aab6f653313d113f0d2ec0374c2d7aee4.tar.gz
xine-lib-2e3f351aab6f653313d113f0d2ec0374c2d7aee4.tar.bz2
Replace usage of xine_xmalloc_aligned() with av_mallocz() from libavutil, link plugins needing it to libavutil.
Diffstat (limited to 'src/video_out/video_out_xshm.c')
-rw-r--r--src/video_out/video_out_xshm.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 40986899a..42190bc4a 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -51,6 +51,9 @@
#include <pthread.h>
#include <netinet/in.h>
+/* libavutil from FFmpeg */
+#include <mem.h>
+
#define LOG_MODULE "video_out_xshm"
#define LOG_VERBOSE
/*
@@ -80,8 +83,6 @@ typedef struct {
XImage *image;
XShmSegmentInfo shminfo;
- uint8_t *chunk[3]; /* mem alloc by xmalloc_aligned */
-
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
uint8_t *rgb_dst;
@@ -380,9 +381,9 @@ static void xshm_frame_dispose (vo_frame_t *vo_img) {
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
free (frame);
}
@@ -530,18 +531,9 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
dispose_ximage (this, &frame->shminfo, frame->image);
- if (frame->chunk[0]){
- free (frame->chunk[0]);
- frame->chunk[0] = NULL;
- }
- if (frame->chunk[1]) {
- free (frame->chunk[1]);
- frame->chunk[1] = NULL;
- }
- if (frame->chunk[2]) {
- free (frame->chunk[2]);
- frame->chunk[2] = NULL;
- }
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
frame->image = NULL;
}
@@ -555,14 +547,12 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
lprintf ("stripe out_ht=%i, deliv_ht=%i\n",