From: Sebastian Dröge Date: Mon, 20 Feb 2012 13:57:11 +0000 (+0100) Subject: seek: Keep a reference to the xoverlay element X-Git-Tag: 1.19.3~511^2~6555^2~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4262e93019b9bc976a899f1bd0686f783293a7b5;p=platform%2Fupstream%2Fgstreamer.git seek: Keep a reference to the xoverlay element --- diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 0a4c3c5..c7b53da 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2476,7 +2476,9 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) gst_structure_has_name (message->structure, "prepare-xwindow-id")) { GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message)); - xoverlay_element = element; + if (xoverlay_element) + gst_object_unref (xoverlay_element); + xoverlay_element = GST_ELEMENT (gst_object_ref (element)); g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid); @@ -3035,6 +3037,9 @@ main (int argc, char **argv) g_print ("NULL pipeline\n"); gst_element_set_state (pipeline, GST_STATE_NULL); + if (xoverlay_element) + gst_object_unref (xoverlay_element); + g_print ("free pipeline\n"); gst_object_unref (pipeline);