summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-06-26 15:14:48 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-06-26 15:14:48 +0000
commite56dbbfd3ca602169f38669a48c554a46c1202a0 (patch)
treec21aea1ab90846191e1010dfe71c408f14611e31
parent96de64de92ca6e0ccb10cbb4ae96126ed8790d8e (diff)
downloadmpv-e56dbbfd3ca602169f38669a48c554a46c1202a0.tar.bz2
mpv-e56dbbfd3ca602169f38669a48c554a46c1202a0.tar.xz
Use FFALIGN and FFMAX3
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29396 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libvo/vo_fbdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index f854b64ecc..11b16d7a02 100644
--- a/libvo/vo_fbdev.c
+++ b/libvo/vo_fbdev.c
@@ -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 fb_mode_t *find_best_mode(int xres, int yres, range_t *hfreq,
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 @@ static struct fb_cmap *make_directcolor_cmap(struct fb_var_screeninfo *var)
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) {