From 21ea779e7aa2b819b9082320d1fcf9eaa0024a37 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 17 Sep 2010 08:59:36 +0000 Subject: vo_vesa, vo_directfb2: Replace local min/max macros by FFMIN/FFMAX git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32282 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_directfb2.c | 9 +++------ libvo/vo_vesa.c | 17 +++++------------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index 3771f3d6a9..1fb5577075 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "config.h" #include "video_out.h" @@ -38,10 +39,6 @@ #include "subopt-helper.h" #include "mp_fifo.h" -#ifndef min -#define min(x,y) (((x)<(y))?(x):(y)) -#endif - // triple buffering #define TRIPLE 1 @@ -1183,7 +1180,7 @@ static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) primarylocked = 1; }; - p=min(w,pitch); + p = FFMIN(w, pitch); dst += y*pitch + x; dst2 = dst + pitch*height - y*pitch + y*pitch/4 - x/2; @@ -1279,7 +1276,7 @@ static uint32_t put_image(mp_image_t *mpi){ primarylocked = 1; }; - p=min(mpi->w,pitch); + p = FFMIN(mpi->w, pitch); src = mpi->planes[0]+mpi->y*mpi->stride[0]+mpi->x; diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c index 98c37bb505..e66208cae2 100644 --- a/libvo/vo_vesa.c +++ b/libvo/vo_vesa.c @@ -41,7 +41,7 @@ #include #include #include - +#include #include #include "video_out.h" @@ -64,13 +64,6 @@ #define MAX_BUFFERS 3 -#ifndef max -#define max(a,b) ((a)>(b)?(a):(b)) -#endif -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - #define UNUSED(x) ((void)(x)) /**< Removes warning about unused arguments */ static const vo_info_t info = @@ -237,7 +230,7 @@ static void vbeCopyBlock(unsigned long offset,uint8_t *image,unsigned long size) while(size) { if(!VALID_WIN_FRAME(offset)) vbeSwitchBank(offset); - delta = min(size,win.high - offset); + delta = FFMIN(size, win.high - offset); fast_memcpy(VIDEO_PTR(offset),&image[src_idx],delta); src_idx += delta; offset += delta; @@ -546,7 +539,7 @@ unsigned fillMultiBuffer( unsigned long vsize, unsigned nbuffs ) mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Can use up to %u video buffers\n",total); i = 0; offset = 0; - total = min(total,nbuffs); + total = FFMIN(total, nbuffs); while(i < total) { multi_buff[i++] = offset; offset += screen_size; } if(!i) mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_VESA] You have too little video memory for this mode:\n[VO_VESA] Required: %08lX present: %08lX.\n", screen_size, vsize); @@ -739,9 +732,9 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin dstH = d_height; } if(vo_screenwidth) w = vo_screenwidth; - else w = max(dstW,width); + else w = FFMAX(dstW, width); if(vo_screenheight) h = vo_screenheight; - else h = max(dstH,height); + else h = FFMAX(dstH, height); for(i=0;i < num_modes;i++) { if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK) -- cgit v1.2.3