[Mplayer-cvslog] CVS: main/libmpcodecs vd_real.c,1.4,1.5

Arpi of Ize arpi at mplayerhq.hu
Sun Jun 9 21:53:16 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv3887

Modified Files:
	vd_real.c 
Log Message:
freebsd support (hack) by Nexus
(f)printf->mp_msg, also needed to avoid use of stderr...


Index: vd_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_real.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vd_real.c	9 Jun 2002 18:20:27 -0000	1.4
+++ vd_real.c	9 Jun 2002 19:53:13 -0000	1.5
@@ -44,10 +44,16 @@
 }
 
 void __pure_virtual(void) {
-	fprintf(stderr, "I'm outa here!\n");
-	exit(1);
+	printf("FATAL: __pure_virtual() called!\n");
+//	exit(1);
 }
 
+#ifdef __FreeBSD__
+void ___brk_addr(void) {exit(0);}
+char** __environ={NULL};
+#undef stderr
+FILE* stderr=NULL;
+#endif
 
 // to set/get/query special features/parameters
 static int control(sh_video_t *sh,int cmd,void* arg,...){
@@ -68,40 +74,28 @@
 		void *handle;
 		char *error;
 
-		fprintf(stderr, "opening dll %s\n", path);
+		mp_msg(MSGT_DECVIDEO,MSGL_INFO, "opening shared obj '%s'\n", path);
 		rv_handle = dlopen (path, RTLD_LAZY);
 		handle=rv_handle;
 		if (!handle) {
-			fputs (dlerror(), stderr);
+			mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error: %s\n",dlerror());
 			return 0;
 		}
 
 		rvyuv_custom_message = dlsym(handle, "RV20toYUV420CustomMessage");
-		if ((error = dlerror()) != NULL)  {
-			fprintf (stderr, "dlsym(rvyuvCustomMessage): %s\n", error);
-			return 0;
-		}
 		rvyuv_free = dlsym(handle, "RV20toYUV420Free");
-		if ((error = dlerror()) != NULL)  {
-			fprintf (stderr, "dlsym(rvyuvFree): %s\n", error);
-			return 0;
-		}
 		rvyuv_hive_message = dlsym(handle, "RV20toYUV420HiveMessage");
-		if ((error = dlerror()) != NULL)  {
-			fprintf (stderr, "dlsym(rvyuvHiveMessage): %s\n", error);
-			return 0;
-		}
 		rvyuv_init = dlsym(handle, "RV20toYUV420Init");
-		if ((error = dlerror()) != NULL)  {
-			fprintf (stderr, "dlsym(rvyuvInit): %s\n", error);
-			return 0;
-		}
 		rvyuv_transform = dlsym(handle, "RV20toYUV420Transform");
-		if ((error = dlerror()) != NULL)  {
-			fprintf (stderr, "dlsym(rvyuvTransform): %s\n", error);
-			return 0;
-		}
-	return 1;
+
+    if(rvyuv_custom_message &&
+       rvyuv_free &&
+       rvyuv_hive_message &&
+       rvyuv_init &&
+       rvyuv_transform) return 1;
+
+    mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n");
+    return 0;
 }
 
 #else
@@ -110,7 +104,7 @@
     void *handle;
     Setup_LDT_Keeper();
     rv_handle = handle = LoadLibraryA(path);
-    printf("win32 real codec handle=%p  \n",handle);
+    mp_msg(MSGT_DECVIDEO,MSGL_V,"win32 real codec handle=%p  \n",handle);
 
     rvyuv_custom_message = GetProcAddress(handle, "RV20toYUV420CustomMessage");
     rvyuv_free = GetProcAddress(handle, "RV20toYUV420Free");




More information about the MPlayer-cvslog mailing list