summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2012-07-03 22:14:37 +0300
committerTorsten Jager <t.jager@gmx.de>2012-07-03 22:14:37 +0300
commitf30794c3060a75b974e624e425ecb46e3bd01265 (patch)
treee681b0f3297231cd25d55b8cf1ffc80009487c58 /src
parentd7ac3547b711f2c7bede4cb6b5131b3b855badb6 (diff)
downloadxine-lib-f30794c3060a75b974e624e425ecb46e3bd01265.tar.gz
xine-lib-f30794c3060a75b974e624e425ecb46e3bd01265.tar.bz2
xshm: no need to zero allocated frames
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_xshm.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 2b6f696b6..c13391b84 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -457,6 +457,7 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
int gui_width;
int gui_height;
double gui_pixel_aspect;
+ int pitch;
flags &= VO_BOTH_FIELDS;
@@ -546,15 +547,18 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
UNLOCK_DISPLAY(this);
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] = 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));
+ pitch = (width + 7) & ~7;
+ frame->vo_frame.pitches[0] = pitch;
+ frame->vo_frame.base[0] = av_malloc (pitch * height);
+ pitch = ((width + 15) & ~15) >> 1;
+ frame->vo_frame.pitches[1] = pitch;
+ frame->vo_frame.pitches[2] = pitch;
+ frame->vo_frame.base[1] = av_malloc (pitch * ((height + 1) / 2));
+ frame->vo_frame.base[2] = av_malloc (pitch * ((height + 1) / 2));
} else {
- frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ pitch = ((width + 3) & ~3) << 1;
+ frame->vo_frame.pitches[0] = pitch;
+ frame->vo_frame.base[0] = av_malloc (pitch * height);
}
lprintf ("stripe out_ht=%i, deliv_ht=%i\n",