mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
gstplayer: Check GstPlayerSignalDispatcher type
Before trying to retrieve a GMainContext from a provided GstPlayerSignalDispatcher, check that it is actually GstPlayerGMainContextSignalDispatcher. If not, use the default GMainContext for dispatching signals via the adapter Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7392>
This commit is contained in:
parent
389f7e0d7b
commit
6cf3d32886
1 changed files with 11 additions and 5 deletions
|
@ -49,6 +49,7 @@
|
||||||
|
|
||||||
#include "gstplayer.h"
|
#include "gstplayer.h"
|
||||||
#include "gstplayer-signal-dispatcher-private.h"
|
#include "gstplayer-signal-dispatcher-private.h"
|
||||||
|
#include "gstplayer-g-main-context-signal-dispatcher.h"
|
||||||
#include "gstplayer-video-renderer-private.h"
|
#include "gstplayer-video-renderer-private.h"
|
||||||
#include "gstplayer-media-info-private.h"
|
#include "gstplayer-media-info-private.h"
|
||||||
#include "gstplayer-wrapped-video-renderer-private.h"
|
#include "gstplayer-wrapped-video-renderer-private.h"
|
||||||
|
@ -576,11 +577,16 @@ gst_player_constructed (GObject * object)
|
||||||
if (self->signal_dispatcher != NULL) {
|
if (self->signal_dispatcher != NULL) {
|
||||||
GMainContext *context = NULL;
|
GMainContext *context = NULL;
|
||||||
|
|
||||||
g_object_get (self->signal_dispatcher, "application-context", &context,
|
if (GST_IS_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER
|
||||||
NULL);
|
(self->signal_dispatcher)) {
|
||||||
self->signal_adapter =
|
g_object_get (self->signal_dispatcher, "application-context", &context,
|
||||||
gst_play_signal_adapter_new_with_main_context (self->play, context);
|
NULL);
|
||||||
g_main_context_unref (context);
|
self->signal_adapter =
|
||||||
|
gst_play_signal_adapter_new_with_main_context (self->play, context);
|
||||||
|
g_main_context_unref (context);
|
||||||
|
} else {
|
||||||
|
self->signal_adapter = gst_play_signal_adapter_new (self->play);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self->signal_adapter = gst_play_signal_adapter_new_sync_emit (self->play);
|
self->signal_adapter = gst_play_signal_adapter_new_sync_emit (self->play);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue