From c42c6d6da0e2a185b86d6010d04564ba02d10524 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 22 Jan 2009 22:09:47 +0000 Subject: [PATCH] Fix use-after-unref problem noticed by Josep Torra Valles, and run gst-indent --- gst/playback/gstplaybasebin.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 6374084dac..d3389df2c0 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -483,8 +483,9 @@ group_commit (GstPlayBaseBin * play_base_bin, gboolean fatal, gboolean subtitle) setup_substreams (play_base_bin); GST_DEBUG_OBJECT (play_base_bin, "Emitting signal"); - res = GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)-> - setup_output_pads (play_base_bin, group); + res = + GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads + (play_base_bin, group); GST_DEBUG_OBJECT (play_base_bin, "done"); GROUP_UNLOCK (play_base_bin); @@ -869,7 +870,6 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin, id = gst_pad_add_buffer_probe (sinkpad, G_CALLBACK (check_queue), preroll); GST_DEBUG_OBJECT (play_base_bin, "Attaching probe to pad %s:%s (%p)", GST_DEBUG_PAD_NAME (sinkpad), sinkpad); - gst_object_unref (sinkpad); g_object_set_data (G_OBJECT (preroll), "probe", GINT_TO_POINTER (id)); /* catch eos and flush events so that we can ignore underruns */ @@ -877,6 +877,8 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin, preroll); g_object_set_data (G_OBJECT (preroll), "eos_probe", GINT_TO_POINTER (id)); + gst_object_unref (sinkpad); + /* When we connect this queue, it will start running and immediatly * fire an underrun. */ g_signal_connect (G_OBJECT (preroll), "underrun", @@ -1216,8 +1218,9 @@ probe_triggered (GstPad * pad, GstEvent * event, gpointer user_data) setup_substreams (play_base_bin); GST_DEBUG ("switching to next group %p - emitting signal", group); /* and signal the new group */ - res = GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)-> - setup_output_pads (play_base_bin, group); + res = + GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads + (play_base_bin, group); GROUP_UNLOCK (play_base_bin);