mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
gtk: Fail initialization of the sink if GTK4 is already initialized in the same process
Initializing GTK3 and GTK4 in the same process does not work and is not supported. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6892>
This commit is contained in:
parent
1a8e7aa92d
commit
cd606696a6
1 changed files with 10 additions and 0 deletions
|
@ -203,6 +203,16 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink)
|
|||
if (gtk_sink->widget != NULL)
|
||||
return g_object_ref (gtk_sink->widget);
|
||||
|
||||
/* Fix segfault when GTK3 and GTK4 are loaded (e.g. `gst-inspect-1.0 -a`)
|
||||
* into the same process.
|
||||
*
|
||||
* GtkNoMediaFile only exists in GTK4 and is registered as part of
|
||||
* gtk_init(). */
|
||||
if (g_type_from_name ("GtkNoMediaFile")) {
|
||||
GST_INFO_OBJECT (gtk_sink, "GTK4 is already initialized");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Ensure GTK is initialized, this has no side effect if it was already
|
||||
* initialized. Also, we do that lazily, so the application can be first */
|
||||
if (!gtk_init_check (NULL, NULL)) {
|
||||
|
|
Loading…
Reference in a new issue