summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-17 08:59:36 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:16:55 +0200
commit21ea779e7aa2b819b9082320d1fcf9eaa0024a37 (patch)
tree1d5778de7aadf9a9d3cc4bbc5a74499a551bcd3c
parente25bc291435045090283c5255904d151dead2cb2 (diff)
downloadmpv-21ea779e7aa2b819b9082320d1fcf9eaa0024a37.tar.bz2
mpv-21ea779e7aa2b819b9082320d1fcf9eaa0024a37.tar.xz
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
-rw-r--r--libvo/vo_directfb2.c9
-rw-r--r--libvo/vo_vesa.c17
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <libavutil/common.h>
#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 <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-
+#include <libavutil/common.h>
#include <vbe.h>
#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)