From 13a702e9e572a2dc9f6b52a1531a2237d4d98ff1 Mon Sep 17 00:00:00 2001 From: Dongxiao Xu Date: Fri, 15 Oct 2010 16:45:21 +0800 Subject: 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. This fixes [BUGID #474] Signed-off-by: Dongxiao Xu --- .../files/owl-video-widget.desktop | 10 ------ .../owl-video-widget/files/owl-video-widget.png | Bin 4923 -> 0 bytes .../owl-video-widget/files/stock_media-play.png | Bin 329 -> 0 bytes .../owl-video-widget/files/stock_volume-0.png | Bin 570 -> 0 bytes .../owl-video-widget/files/stock_volume-max.png | Bin 689 -> 0 bytes .../owl-video-widget/files/stock_volume-med.png | Bin 630 -> 0 bytes .../owl-video-widget/files/stock_volume-min.png | Bin 570 -> 0 bytes .../owl-video/gtk_multithread_safe.patch | 38 +++++++++++++++++++++ .../owl-video/owl-video-widget.desktop | 10 ++++++ .../owl-video/owl-video-widget.png | Bin 0 -> 4923 bytes .../owl-video/stock_media-play.png | Bin 0 -> 329 bytes .../owl-video-widget/owl-video/stock_volume-0.png | Bin 0 -> 570 bytes .../owl-video/stock_volume-max.png | Bin 0 -> 689 bytes .../owl-video/stock_volume-med.png | Bin 0 -> 630 bytes .../owl-video/stock_volume-min.png | Bin 0 -> 570 bytes .../recipes-sato/owl-video-widget/owl-video_svn.bb | 3 +- 16 files changed, 50 insertions(+), 11 deletions(-) delete mode 100644 meta/recipes-sato/owl-video-widget/files/owl-video-widget.desktop delete mode 100644 meta/recipes-sato/owl-video-widget/files/owl-video-widget.png delete mode 100644 meta/recipes-sato/owl-video-widget/files/stock_media-play.png delete mode 100644 meta/recipes-sato/owl-video-widget/files/stock_volume-0.png delete mode 100644 meta/recipes-sato/owl-video-widget/files/stock_volume-max.png delete mode 100644 meta/recipes-sato/owl-video-widget/files/stock_volume-med.png delete mode 100644 meta/recipes-sato/owl-video-widget/files/stock_volume-min.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/gtk_multithread_safe.patch create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.desktop create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/stock_media-play.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/stock_volume-0.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/stock_volume-max.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/stock_volume-med.png create mode 100644 meta/recipes-sato/owl-video-widget/owl-video/stock_volume-min.png (limited to 'meta/recipes-sato') diff --git a/meta/recipes-sato/owl-video-widget/files/owl-video-widget.desktop b/meta/recipes-sato/owl-video-widget/files/owl-video-widget.desktop deleted file mode 100644 index e7af07ee6..000000000 --- a/meta/recipes-sato/owl-video-widget/files/owl-video-widget.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Video -Exec=video -Icon=video-player -Terminal=false -Type=Application -Categories=AudioVideo;Video;Player; -X-MB-SingleInstance=true -StartupNotify=true -Comment=Video Player diff --git a/meta/recipes-sato/owl-video-widget/files/owl-video-widget.png b/meta/recipes-sato/owl-video-widget/files/owl-video-widget.png deleted file mode 100644 index f463fe186..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/owl-video-widget.png and /dev/null differ diff --git a/meta/recipes-sato/owl-video-widget/files/stock_media-play.png b/meta/recipes-sato/owl-video-widget/files/stock_media-play.png deleted file mode 100644 index c2b9c582a..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/stock_media-play.png and /dev/null differ diff --git a/meta/recipes-sato/owl-video-widget/files/stock_volume-0.png b/meta/recipes-sato/owl-video-widget/files/stock_volume-0.png deleted file mode 100644 index f3f57143d..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/stock_volume-0.png and /dev/null differ diff --git a/meta/recipes-sato/owl-video-widget/files/stock_volume-max.png b/meta/recipes-sato/owl-video-widget/files/stock_volume-max.png deleted file mode 100644 index 03f5a03b4..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/stock_volume-max.png and /dev/null differ diff --git a/meta/recipes-sato/owl-video-widget/files/stock_volume-med.png b/meta/recipes-sato/owl-video-widget/files/stock_volume-med.png deleted file mode 100644 index f774e42bb..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/stock_volume-med.png and /dev/null differ diff --git a/meta/recipes-sato/owl-video-widget/files/stock_volume-min.png b/meta/recipes-sato/owl-video-widget/files/stock_volume-min.png deleted file mode 100644 index f3f57143d..000000000 Binary files a/meta/recipes-sato/owl-video-widget/files/stock_volume-min.png and /dev/null differ 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 index 000000000..e153c5e3b --- /dev/null +++ b/meta/recipes-sato/owl-video-widget/owl-video/gtk_multithread_safe.patch @@ -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 + +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. diff --git a/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.desktop b/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.desktop new file mode 100644 index 000000000..e7af07ee6 --- /dev/null +++ b/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Video +Exec=video +Icon=video-player +Terminal=false +Type=Application +Categories=AudioVideo;Video;Player; +X-MB-SingleInstance=true +StartupNotify=true +Comment=Video Player diff --git a/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.png b/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.png new file mode 100644 index 000000000..f463fe186 Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/owl-video-widget.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video/stock_media-play.png b/meta/recipes-sato/owl-video-widget/owl-video/stock_media-play.png new file mode 100644 index 000000000..c2b9c582a Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/stock_media-play.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-0.png b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-0.png new file mode 100644 index 000000000..f3f57143d Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-0.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-max.png b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-max.png new file mode 100644 index 000000000..03f5a03b4 Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-max.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-med.png b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-med.png new file mode 100644 index 000000000..f774e42bb Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-med.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-min.png b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-min.png new file mode 100644 index 000000000..f3f57143d Binary files /dev/null and b/meta/recipes-sato/owl-video-widget/owl-video/stock_volume-min.png differ diff --git a/meta/recipes-sato/owl-video-widget/owl-video_svn.bb b/meta/recipes-sato/owl-video-widget/owl-video_svn.bb index 50027f5f2..07c52ef32 100644 --- a/meta/recipes-sato/owl-video-widget/owl-video_svn.bb +++ b/meta/recipes-sato/owl-video-widget/owl-video_svn.bb @@ -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 \ -- cgit v1.2.3