Update of /cvsroot/xine/xine-lib/src/xine-engine
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26422

Modified Files:
        load_plugins.c 
Log Message:
When initializing the class of a video output plugin
the visual type should be checked too.
That because a plugin with the same id may support different visuals 
(e.g. xv -> VISUAL_TYPE_X11, xv -> VISUAL_TYPE_X11_2).


Index: load_plugins.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-engine/load_plugins.c,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -r1.227 -r1.228
--- load_plugins.c      28 Oct 2006 17:02:51 -0000      1.227
+++ load_plugins.c      23 Nov 2006 21:05:31 -0000      1.228
@@ -670,6 +670,30 @@
  * generic 2nd stage plugin loader
  */
 
+static inline int _plugin_info_equal(const plugin_info_t *a, 
+                                     const plugin_info_t *b) {
+  if (a->type != b->type || 
+      a->API != b->API ||
+      strcasecmp(a->id, b->id) ||
+      a->version != b->version)
+    return 0;
+   
+  switch (a->type & PLUGIN_TYPE_MASK) {
+    case PLUGIN_VIDEO_OUT:
+      /* FIXME: Could special_info be NULL? */
+      if (a->special_info && b->special_info) {
+        return (((vo_info_t*)a->special_info)->visual_type ==
+                ((vo_info_t*)b->special_info)->visual_type);
+      }
+      break;
+      
+    default:
+      break;
+  }
+  
+  return 1;
+}
+
 static int _load_plugin_class(xine_t *this,
                              plugin_node_t *node,
                              void *data) {
@@ -698,10 +722,7 @@
     if ((info = dlsym(node->file->lib_handle, "xine_plugin_info"))) {
       /* TODO: use sigsegv handler */
       while (info->type != PLUGIN_NONE){
-       if (info->type == target->type
-           && info->API == target->API
-           && !strcasecmp(info->id, target->id)
-           && info->version == target->version){
+       if (_plugin_info_equal(info, target)){
          if ((node->plugin_class = info->init(this, data))) {
            inc_file_ref(node->file);
            return 1;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to