[xiph-commits] r2905 - liboggplay/trunk/plugin

shans at svn.annodex.net shans at svn.annodex.net
Tue Jun 12 21:56:00 PDT 2007


Author: shans
Date: 2007-06-12 21:55:58 -0700 (Tue, 12 Jun 2007)
New Revision: 2905

Modified:
   liboggplay/trunk/plugin/plugin_gui_linux.c
Log:
Added CMML functions, and some printfs which I will remove when I've found
my segfault bug.



Modified: liboggplay/trunk/plugin/plugin_gui_linux.c
===================================================================
--- liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-13 04:55:41 UTC (rev 2904)
+++ liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-13 04:55:58 UTC (rev 2905)
@@ -72,7 +72,7 @@
   gboolean	            audio_opened;
   gboolean	            tried_audio;
   int64_t               playback_target;
-  void                * tools_handle;
+  nsPluginInstance    * pluginInstance;
  } PluginWindowInfo;
 
 void
@@ -153,7 +153,7 @@
   }
  
   if (frame_data.cmml_strings != NULL) {      
-      on_cmml_data(info->tools_handle, frame_data.cmml_strings, 
+      onCMMLData(info->pluginInstance, frame_data.cmml_strings, 
                       frame_data.cmml_size);
   }
 
@@ -240,6 +240,7 @@
 gboolean
 display_signal (gpointer _info) {
   PluginWindowInfo  * info = (PluginWindowInfo *)_info;
+  printf("display thread: signaling startup\n");
   SEM_SIGNAL(info->start_stop_sem);
   return FALSE;
 }
@@ -249,6 +250,8 @@
 
   PluginWindowInfo  * info = (PluginWindowInfo *)_info;
 
+  printf("display thread: started\n");
+
   /*
    * construct a new toplevel window to draw into.  Make sure window is
    * realised so that it has an underlying XWindow attached to it.
@@ -271,13 +274,19 @@
 
   //SEM_SIGNAL(info->start_stop_sem);
   gtk_init_add (display_signal, info);
+
+  printf("display thread: entering gtk main\n");
+
   gtk_main();
+
+  printf("display thread: exited gtk main\n");
 #ifdef USE_AUDIO  
   if (info->audio_opened == TRUE)
     sa_device_close(info->audio_handle);
   info->audio_handle = NULL;
   info->audio_opened = FALSE;
 #endif
+  printf("display thread: signalling safe shutdown\n");
   info->shutdown_gui = 0;
 
   pthread_exit(NULL);
@@ -285,8 +294,8 @@
 }
 
 void *
-initialise_gui(NPWindow * aWindow, void * ogg_handle, void * tools_handle)
-{
+initialise_gui(nsPluginInstance *instance, NPWindow * aWindow, 
+                void * ogg_handle) {
 
   GtkWidget * plug;
   PluginWindowInfo * info;
@@ -295,10 +304,10 @@
   
   /* allocate structure */ 
   info = malloc(sizeof(PluginWindowInfo));
+  info->pluginInstance = instance;
   info->width = aWindow->width;
   info->height = aWindow->height;
   info->ogg_handle = ogg_handle;
-  info->tools_handle = tools_handle;
   info->shutdown_gui = 0;
   info->window = (GtkWidget*)plug;
   info->new_oggplay_handle = NULL;
@@ -323,7 +332,9 @@
   /*
    * wait for the thread to start up
    */
+  printf("waiting for display thread startup\n");
   SEM_WAIT(info->start_stop_sem);
+  printf("waited for display thread startup\n");
 
   return info;
 
@@ -390,6 +401,7 @@
   PluginWindowInfo  * info = (PluginWindowInfo *)handle;
   gboolean      result;
 
+  printf("signalling shutdown of gui\n");
   info->shutdown_gui = 1;
 
   g_signal_emit_by_name(info->window, "destroy-event", NULL, &result);
@@ -397,13 +409,20 @@
   while (info->shutdown_gui) {
     oggplay_millisleep(10);
   }
+  printf("recieved gui shutdown response\n");
 
   shut_oggplay(info->ogg_handle);
-  
+ 
+  printf("closed oggplay\n");
+
   SEM_CLOSE(info->start_stop_sem);
   SEM_CLOSE(info->oggplay_replace_sem);
 
+  printf("closed semaphores\n");
+
   free(info);
   
+  printf("freed info\n");
+
 }
 



More information about the commits mailing list