changeset 32198:5c91b8727591

Replace local min/max macros by FFMIN/FFMAX.
author diego
date Fri, 17 Sep 2010 08:59:36 +0000
parents ed12c6f6abd8
children 339e4bb9c262
files libvo/vo_directfb2.c libvo/vo_vesa.c
diffstat 2 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directfb2.c	Fri Sep 17 08:18:47 2010 +0000
+++ b/libvo/vo_directfb2.c	Fri Sep 17 08:59:36 2010 +0000
@@ -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
 
@@ -1185,7 +1182,7 @@
 		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;
@@ -1281,7 +1278,7 @@
 		primarylocked = 1;
         };
 
-	p=min(mpi->w,pitch);
+	p = FFMIN(mpi->w, pitch);
 
 	src = mpi->planes[0]+mpi->y*mpi->stride[0]+mpi->x;
 
--- a/libvo/vo_vesa.c	Fri Sep 17 08:18:47 2010 +0000
+++ b/libvo/vo_vesa.c	Fri Sep 17 08:59:36 2010 +0000
@@ -42,7 +42,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-
+#include <libavutil/common.h>
 #include <vbe.h>
 
 #include "video_out.h"
@@ -65,13 +65,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 =
@@ -238,7 +231,7 @@
    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;
@@ -547,7 +540,7 @@
     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_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory, screen_size, vsize);
@@ -738,9 +731,9 @@
 	    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)