playback/player: don't unref gtk_sink but sink it

Commit 5b8ba60c was added because of a memory leak when gtksink was
used as renderer. Nonetheless the patch didn't consider two facts:

1\ that the gtk_sink element was in floating state
2\ there is another code path where the gtk_sink element is already
   sank

Thus the correct fix, is not to ref and unref gtk_sink, but sink it.

https://bugzilla.gnome.org/show_bug.cgi?id=781904
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-04-28 16:25:42 +02:00 committed by Sebastian Dröge
parent 175f7c8da1
commit ff1a6546da

View file

@ -113,14 +113,12 @@ gst_player_gtk_video_renderer_init (GstPlayerGtkVideoRenderer * self)
self->sink = sink;
} else {
gtk_sink = gst_element_factory_make ("gtksink", NULL);
self->sink = gst_object_ref (gtk_sink);
self->sink = gst_object_ref_sink (gtk_sink);
}
g_assert (self->sink != NULL);
g_object_get (gtk_sink, "widget", &self->widget, NULL);
gst_object_unref (gtk_sink);
}
static GstElement *gst_player_gtk_video_renderer_create_video_sink