diff options
Diffstat (limited to 'src/video_out/video_out_raw.c')
-rw-r--r-- | src/video_out/video_out_raw.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c index 4ff68b164..e6961c4a7 100644 --- a/src/video_out/video_out_raw.c +++ b/src/video_out/video_out_raw.c @@ -54,14 +54,17 @@ #include "yuv2rgb.h" #include <xine/xineutils.h> - +#ifdef HAVE_FFMPEG_AVUTIL_H +# include <mem.h> +#else +# include <libavutil/mem.h> +#endif typedef struct { vo_frame_t vo_frame; int width, height, format, flags; double ratio; - uint8_t *chunk[4]; /* mem alloc by xmalloc_aligned */ uint8_t *rgb, *rgb_dst; yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */ @@ -278,10 +281,10 @@ static void raw_frame_dispose (vo_frame_t *vo_img) frame->yuv2rgb->dispose (frame->yuv2rgb); - free (frame->chunk[0]); - free (frame->chunk[1]); - free (frame->chunk[2]); - free (frame->chunk[3]); + av_free (frame->vo_frame.base[0]); + av_free (frame->vo_frame.base[1]); + av_free (frame->vo_frame.base[2]); + av_free (frame->rgb); free (frame); } @@ -333,26 +336,25 @@ static void raw_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_ge flags &= VO_BOTH_FIELDS; /* (re-) allocate render space */ - free (frame->chunk[0]); - free (frame->chunk[1]); - free (frame->chunk[2]); - free (frame->chunk[3]); + av_free (frame->vo_frame.base[0]); + av_free (frame->vo_frame.base[1]); + av_free (frame->vo_frame.base[2]); + av_free (frame->rgb); if (format == XINE_IMGFMT_YV12) { 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); + frame->vo_frame.base[1] = NULL; + frame->vo_frame.base[2] = NULL; } - frame->rgb = xine_xmalloc_aligned (16, BYTES_PER_PIXEL*width*height, - (void **) &frame->chunk[3]); + frame->rgb = av_mallocz (BYTES_PER_PIXEL*width*height); /* set up colorspace converter */ switch (flags) { |