From: Tim-Philipp Müller Date: Wed, 29 Mar 2006 11:31:55 +0000 (+0000) Subject: gst/mpegstream/gstmpegparse.c: Don't unref event unconditionally after giving away... X-Git-Tag: 1.19.3~505^2~1984 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=698b9ab2aee42254da123f85d78b1aad2fa8079e;p=platform%2Fupstream%2Fgstreamer.git gst/mpegstream/gstmpegparse.c: Don't unref event unconditionally after giving away ownership (gst_pad_push_event(), g... Original commit message from CVS: * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_handle_src_event): Don't unref event unconditionally after giving away ownership (gst_pad_push_event(), gst_pad_send_event() and gst_pad_event_default() take ownership of the event passed to them). Fixes warnings/crashes caused by navigation events. --- diff --git a/ChangeLog b/ChangeLog index eee90fd..e22a62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-29 Tim-Philipp Müller + + * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_handle_src_event): + Don't unref event unconditionally after giving away ownership + (gst_pad_push_event(), gst_pad_send_event() and + gst_pad_event_default() take ownership of the event + passed to them). Fixes warnings/crashes caused by + navigation events. + 2006-03-28 Tim-Philipp Müller * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_send_subbuffer): diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index 5ad896f..894c025 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -1181,12 +1181,11 @@ gst_mpeg_parse_handle_src_event (GstPad * pad, GstEvent * event) GstMPEGParse *mpeg_parse = GST_MPEG_PARSE (gst_pad_get_parent (pad)); - GST_INFO_OBJECT (mpeg_parse, "Event received"); + GST_LOG_OBJECT (mpeg_parse, "got %s event", GST_EVENT_TYPE_NAME (event)); + switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: { - GST_INFO_OBJECT (mpeg_parse, "Seek event received"); - #ifdef FIXME /* First try to use the index if we have one. */ if (mpeg_parse->index) { @@ -1200,12 +1199,12 @@ gst_mpeg_parse_handle_src_event (GstPad * pad, GstEvent * event) } if (!upstream) { + gst_event_unref (event); res = FALSE; goto done; } - gst_pad_push_event (pad, upstream); - + res = gst_pad_event_default (pad, upstream); break; } case GST_EVENT_NAVIGATION: @@ -1213,14 +1212,13 @@ gst_mpeg_parse_handle_src_event (GstPad * pad, GstEvent * event) res = gst_pad_push_event (mpeg_parse->sinkpad, event); break; default: - res = FALSE; + res = gst_pad_event_default (pad, event); break; } done: gst_object_unref (mpeg_parse); - gst_event_unref (event); return res; }