[MPlayer-cvslog] CVS: main/libmpcodecs vf_qp.c,1.2,1.3

Diego Biurrun CVS syncmail at mplayerhq.hu
Wed Oct 5 11:39:10 CEST 2005


CVS change done by Diego Biurrun CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv15709/libmpcodecs

Modified Files:
	vf_qp.c 
Log Message:
Compilation fix for systems lacking lrintf like e.g. NetBSD.
patch by Jan Knutar < jknutar -- at -- nic -- dot -- fi > and me


Index: vf_qp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_qp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vf_qp.c	5 Feb 2004 22:03:42 -0000	1.2
+++ vf_qp.c	5 Oct 2005 09:39:08 -0000	1.3
@@ -36,14 +36,24 @@
                void *opaque);
 #endif
 
+// Needed to bring in lrintf.
+#define HAVE_AV_CONFIG_H
+
 #ifdef USE_LIBAVCODEC_SO
 #include <ffmpeg/avcodec.h>
 #include <ffmpeg/dsputil.h>
+#include <ffmpeg/common.h>
 #else
 #include "../libavcodec/avcodec.h"
 #include "../libavcodec/dsputil.h"
+#include "../libavutil/common.h"
 #endif
 
+/* FIXME: common.h defines printf away when HAVE_AV_CONFIG
+ * is defined, but mp_image.h needs printf.
+ */
+#undef printf
+
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
 #endif
@@ -68,7 +78,7 @@
         int i;
 
 	vf->priv->qp_stride= (width+15)>>4;
-        vf->priv->qp= malloc(vf->priv->qp_stride*h*sizeof(int8_t));
+        vf->priv->qp= av_malloc(vf->priv->qp_stride*h*sizeof(int8_t));
         
         for(i=-129; i<128; i++){
             double const_values[]={
@@ -155,10 +165,10 @@
 static void uninit(struct vf_instance_s* vf){
 	if(!vf->priv) return;
 
-	if(vf->priv->qp) free(vf->priv->qp);
+	if(vf->priv->qp) av_free(vf->priv->qp);
 	vf->priv->qp= NULL;
 	
-	free(vf->priv);
+	av_free(vf->priv);
 	vf->priv=NULL;
 }
 
@@ -168,7 +178,7 @@
     vf->put_image=put_image;
     vf->get_image=get_image;
     vf->uninit=uninit;
-    vf->priv=malloc(sizeof(struct vf_priv_s));
+    vf->priv=av_malloc(sizeof(struct vf_priv_s));
     memset(vf->priv, 0, sizeof(struct vf_priv_s));
     
 //    avcodec_init();




More information about the MPlayer-cvslog mailing list