sinek/src gtkxine.c,1.2,1.3

[email protected] Sun, 05 Jan 2003 04:07:19 -0800
Newsgroups gmane.comp.video.sinek.cvs
Message-ID <[email protected]>
Update of /cvsroot/sinek/sinek/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26603/src

Modified Files:
	gtkxine.c 
Log Message:
segfault fixes.  gtk_xine_set_video_driver() needs to pass a visual struct to
xine_open_video_driver to fix current segv.  will fix tomorrow.


Index: gtkxine.c
===================================================================
RCS file: /cvsroot/sinek/sinek/src/gtkxine.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gtkxine.c	5 Jan 2003 11:37:12 -0000	1.2
+++ gtkxine.c	5 Jan 2003 12:07:17 -0000	1.3
@@ -380,6 +380,8 @@
 
 	xine_config_load (xine->xine, conffile);
 	xine->conf_loaded = 1;
+	xine_init (xine->xine);
+
 	return 0;
 }
 
@@ -473,7 +475,7 @@
 		xine_close_audio_driver (xine->xine, xine->ao_driver);
 		xine->ao_driver = NULL;
 	}
-		
+	
 	if (strcmp (name, "null") == 0)
 		return name;
 	if (strcmp (name, "auto") != 0)
@@ -516,7 +518,7 @@
 		/* autodetect */
 		driver_ids = xine_list_video_output_plugins (xine->xine);
 		for (i = 0; driver_ids[i] != NULL; i++) {
-			xine->vo_driver = xine_open_video_driver (xine->xine, driver_ids[i], XINE_VISUAL_TYPE_X11, NULL);
+			xine->vo_driver = xine_open_video_driver (xine->xine, driver_ids[i], XINE_VISUAL_TYPE_X11, NULL); /* TODO: pass a visual type struct */
 			if (xine->vo_driver) {
 				name = (const char *) driver_ids[i];
 				break;
@@ -660,4 +662,33 @@
 int gtk_xine_get_verbosity (GtkXine *xine)
 {
 }
+#endif
+
+#ifdef GTK_XINE_TEST
+
+const char *rcfile (void)
+{
+	static char *x = NULL;
+	if (!x)
+		x = g_strconcat (g_get_home_dir (), "/.sinek/config", NULL);
+	return x;
+}
+	
+int main (int argc, char **argv) 
+{
+	GtkWidget *w;
+
+	gtk_init (&argc, &argv);
+	
+	w = gtk_xine_new ();
+	gtk_xine_config_load (GTK_XINE (w), rcfile ());
+	g_print ("Loaded audio driver '%s'\n", gtk_xine_set_audio_driver (GTK_XINE (w), "auto"));
+	g_print ("Loaded video driver '%s'\n", gtk_xine_set_video_driver (GTK_XINE (w), "auto"));
+
+	gtk_main();
+	gtk_widget_destroy (w);
+
+	return 0;
+}
+
 #endif




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf