From: Mark Nauwelaerts Date: Tue, 11 Jan 2011 11:05:13 +0000 (+0100) Subject: baseparse: arrange for consistent event handling X-Git-Tag: RELEASE-0.10.33~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef641d051575a225b04048fd7b9d8710c838a0bd;p=platform%2Fupstream%2Fgstreamer.git baseparse: arrange for consistent event handling --- diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index ac9d7f2e14..887bb8bb9f 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -985,8 +985,6 @@ gst_base_parse_src_event (GstPad * pad, GstEvent * event) if (!handled) ret = gst_pad_event_default (pad, event); - else - gst_event_unref (event); gst_object_unref (parse); return ret; @@ -3273,11 +3271,12 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) * it fails upstream */ if (format != GST_FORMAT_TIME) { /* default action delegates to upstream */ - return FALSE; + res = FALSE; + goto done; } else { gst_event_ref (event); - if (gst_pad_push_event (parse->sinkpad, event)) { - return TRUE; + if ((res = gst_pad_push_event (parse->sinkpad, event))) { + goto done; } } @@ -3439,6 +3438,9 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) (GstTaskFunction) gst_base_parse_loop, parse->sinkpad); GST_PAD_STREAM_UNLOCK (parse->sinkpad); + + /* handled seek */ + res = TRUE; } else { GstEvent *new_event; GstBaseParseSeek *seek; @@ -3479,6 +3481,9 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) } done: + /* handled event is ours to free */ + if (res) + gst_event_unref (event); return res; /* ERRORS */