aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-08-10 15:42:49 +0300
committerRoss Burton <ross.burton@intel.com>2012-08-10 15:42:49 +0300
commit07ab48f331a5e6e0d169e4892c7eb1fc22dc0b9d (patch)
tree9724ff76a7f5286d7e49ed4902608a6efb774172
parentc53b0a85b93ea3a5241467d93e9661b800940a36 (diff)
downloadowl-video-master.tar.gz
owl-video-master.tar.bz2
owl-video-master.zip
Use gdk_threads_enter/gdk_threads_leave to ensure gtk multithread safeHEADmaster
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.
-rw-r--r--src/video.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video.c b/src/video.c
index 52c2a94..7a5ff8f 100644
--- a/src/video.c
+++ b/src/video.c
@@ -96,6 +96,7 @@ error_cb (OwlVideoWidget *video_widget,
{
GtkWidget *dialog;
+ gdk_threads_enter();
dialog = gtk_message_dialog_new (data->window,
GTK_DIALOG_NO_SEPARATOR,
GTK_MESSAGE_ERROR,
@@ -103,6 +104,7 @@ error_cb (OwlVideoWidget *video_widget,
error->message);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
+ gdk_threads_leave();
}
/**
@@ -606,7 +608,9 @@ main (int argc, char **argv)
gtk_widget_show_all (GTK_WIDGET (data->window));
+ gdk_threads_enter();
gtk_main ();
+ gdk_threads_leave();
/**
* Cleanup.