# HG changeset patch # User reimar # Date 1246029288 0 # Node ID 80ff0cd8f427244ef4146e48d055a66ca6d4c3f4 # Parent 22db6af09a1d17498309233bd4cfb2d8b89b9082 Use FFALIGN and FFMAX3 diff -r 22db6af09a1d -r 80ff0cd8f427 libvo/vo_fbdev.c --- a/libvo/vo_fbdev.c Fri Jun 26 14:43:03 2009 +0000 +++ b/libvo/vo_fbdev.c Fri Jun 26 15:14:48 2009 +0000 @@ -46,6 +46,7 @@ #endif #include "aspect.h" #include "mp_msg.h" +#include "libavutil/common.h" static const vo_info_t info = { "Framebuffer Device", @@ -491,7 +492,7 @@ static void set_bpp(struct fb_var_screeninfo *p, int bpp) { - p->bits_per_pixel = (bpp + 1) & ~1; + p->bits_per_pixel = FFALIGN(bpp, 2); p->red.msb_right = p->green.msb_right = p->blue.msb_right = p->transp.msb_right = 0; p->transp.offset = p->transp.length = 0; p->blue.offset = 0; @@ -610,8 +611,7 @@ bcols = 1 << var->blue.length; /* Make our palette the length of the deepest color */ - cols = rcols > gcols ? rcols : gcols; - cols = cols > bcols ? cols : bcols; + cols = FFMAX3(rcols, gcols, bcols); red = malloc(cols * sizeof(red[0])); if (!red) {