]> code.ossystems Code Review - openembedded-core.git/commitdiff
Use gdk_threads_enter/gdk_threads_leave to ensure gtk multithread safe
authorDongxiao Xu <dongxiao.xu@intel.com>
Fri, 15 Oct 2010 08:45:21 +0000 (16:45 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 15 Oct 2010 10:30:49 +0000 (11:30 +0100)
If the video player tries to play an unknown type file, it will enter
the error_cb() function, which is called in another thread.
Use gdk_threads_enter/gdk_threads_leave to ensure the safe of gtk
multi-thread operation.

This fixes [BUGID #474]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
meta/recipes-sato/owl-video-widget/owl-video/gtk_multithread_safe.patch [new file with mode: 0644]
meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.desktop [moved from meta/recipes-sato/owl-video-widget/files/owl-video-widget.desktop with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.png [moved from meta/recipes-sato/owl-video-widget/files/owl-video-widget.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/stock_media-play.png [moved from meta/recipes-sato/owl-video-widget/files/stock_media-play.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/stock_volume-0.png [moved from meta/recipes-sato/owl-video-widget/files/stock_volume-0.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/stock_volume-max.png [moved from meta/recipes-sato/owl-video-widget/files/stock_volume-max.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/stock_volume-med.png [moved from meta/recipes-sato/owl-video-widget/files/stock_volume-med.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video/stock_volume-min.png [moved from meta/recipes-sato/owl-video-widget/files/stock_volume-min.png with 100% similarity]
meta/recipes-sato/owl-video-widget/owl-video_svn.bb

diff --git a/meta/recipes-sato/owl-video-widget/owl-video/gtk_multithread_safe.patch b/meta/recipes-sato/owl-video-widget/owl-video/gtk_multithread_safe.patch
new file mode 100644 (file)
index 0000000..e153c5e
--- /dev/null
@@ -0,0 +1,38 @@
+Use gdk_threads_enter/gdk_threads_leave to ensure gtk multithread safe
+
+If the video player tries to play an unknown type file, it will enter
+the error_cb() function, which is called in another thread.
+Use gdk_threads_enter/gdk_threads_leave to ensure the safe of gtk
+multi-thread operation.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN video-orig/src/video.c video/src/video.c
+--- video-orig/src/video.c     2010-10-15 16:07:26.522346398 +0800
++++ video/src/video.c  2010-10-15 16:25:51.780296717 +0800
+@@ -96,6 +96,7 @@
+ {
+         GtkWidget *dialog;
++        gdk_threads_enter();
+         dialog = gtk_message_dialog_new (data->window,
+                                          GTK_DIALOG_NO_SEPARATOR,
+                                          GTK_MESSAGE_ERROR,
+@@ -103,6 +104,7 @@
+                                          error->message);
+         gtk_dialog_run (GTK_DIALOG (dialog));
+         gtk_widget_destroy (dialog);
++        gdk_threads_leave();
+ }
+ /**
+@@ -606,7 +608,9 @@
+         
+         gtk_widget_show_all (GTK_WIDGET (data->window));
++        gdk_threads_enter();
+         gtk_main ();
++        gdk_threads_leave();
+         /**
+          * Cleanup.
index 50027f5f20ecd42ef07d50aa6578bb31c225425a..07c52ef327287305dac719ef429d79d6d95990c3 100644 (file)
@@ -9,11 +9,12 @@ SECTION = "x11"
 DEPENDS = "libowl-av"
 
 PV = "0.0+svnr${SRCREV}"
-PR = "r1"
+PR = "r2"
 
 S = "${WORKDIR}/video"
 
 SRC_URI = "svn://svn.o-hand.com/repos/misc/trunk;module=video;proto=http \
+           file://gtk_multithread_safe.patch \
            file://owl-video-widget.png \
            file://stock_media-play.png \
            file://stock_volume-0.png \