From 13363f2388a511c6fb0df18eabce7a13f36c1773 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Wed, 27 Dec 2017 13:08:18 +0000 Subject: [PATCH] player: transfer ownership of info properties The previous code would emit GObject critical warnings when the info properties are NULL. https://bugzilla.gnome.org/show_bug.cgi?id=791982 --- gst-libs/gst/player/gstplayer.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index c6f0b018f2..2b324267c0 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -773,29 +773,25 @@ gst_player_get_property (GObject * object, guint prop_id, } case PROP_MEDIA_INFO:{ GstPlayerMediaInfo *media_info = gst_player_get_media_info (self); - g_value_set_object (value, media_info); - g_object_unref (media_info); + g_value_take_object (value, media_info); break; } case PROP_CURRENT_AUDIO_TRACK:{ GstPlayerAudioInfo *audio_info = gst_player_get_current_audio_track (self); - g_value_set_object (value, audio_info); - g_object_unref (audio_info); + g_value_take_object (value, audio_info); break; } case PROP_CURRENT_VIDEO_TRACK:{ GstPlayerVideoInfo *video_info = gst_player_get_current_video_track (self); - g_value_set_object (value, video_info); - g_object_unref (video_info); + g_value_take_object (value, video_info); break; } case PROP_CURRENT_SUBTITLE_TRACK:{ GstPlayerSubtitleInfo *subtitle_info = gst_player_get_current_subtitle_track (self); - g_value_set_object (value, subtitle_info); - g_object_unref (subtitle_info); + g_value_take_object (value, subtitle_info); break; } case PROP_VOLUME: