diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2007-11-13 06:23:51 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2007-11-13 06:23:51 +0000 |
commit | 34c221a52f3aec1726c8d390bee259c1381fa8a9 (patch) | |
tree | 25177b61a5a56fc74d72d6718321ad73158a6fad | |
parent | 85ea09f1431d759eeeccc67877a3ae165272aa82 (diff) |
gst/wavparse/gstwavparse.c: Ref the element when we should, but not when we its not needed. Reflow the event_handling...
Original commit message from CVS:
* gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers),
(gst_wavparse_pad_convert), (gst_wavparse_pad_query),
(gst_wavparse_srcpad_event):
Ref the element when we should, but not when we its not needed. Reflow
the event_handling to not leak the event.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | gst/wavparse/gstwavparse.c | 23 |
2 files changed, 19 insertions, 14 deletions
@@ -1,3 +1,11 @@ +2007-11-13 Stefan Kost <ensonic@users.sf.net> + + * gst/wavparse/gstwavparse.c: (gst_wavparse_stream_headers), + (gst_wavparse_pad_convert), (gst_wavparse_pad_query), + (gst_wavparse_srcpad_event): + Ref the element when we should, but not when we its not needed. Reflow + the event_handling to not leak the event. + 2007-11-12 Edward Hervey <bilboed@bilboed.com> * gst/qtdemux/qtdemux.c: (gst_qtdemux_change_state), @@ -10,7 +18,7 @@ * gst/avi/gstavidemux.c: * gst/qtdemux/qtdemux.c: - Drop EOS in _handle_src_event(). Fix the refcount in qtdemux that + Drop QOS in _handle_src_event(). Fix the refcount in qtdemux that previous commit messed up. 2007-11-12 Stefan Kost <ensonic@users.sf.net> diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 2e0d1fc0..8512ed52 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1851,7 +1851,7 @@ gst_wavparse_pad_convert (GstPad * pad, GstWavParse *wavparse; gboolean res = TRUE; - wavparse = GST_WAVPARSE (gst_pad_get_parent (pad)); + wavparse = GST_WAVPARSE (GST_PAD_PARENT (pad)); if (*dest_format == src_format) { *dest_value = src_value; @@ -1941,8 +1941,6 @@ gst_wavparse_pad_convert (GstPad * pad, } done: - gst_object_unref (wavparse); - return res; /* ERRORS */ @@ -1973,7 +1971,7 @@ static gboolean gst_wavparse_pad_query (GstPad * pad, GstQuery * query) { gboolean res = TRUE; - GstWavParse *wav = GST_WAVPARSE (GST_PAD_PARENT (pad)); + GstWavParse *wav = GST_WAVPARSE (gst_pad_get_parent (pad)); /* only if we know */ if (wav->state != GST_WAVPARSE_DATA) @@ -2062,33 +2060,32 @@ gst_wavparse_pad_query (GstPad * pad, GstQuery * query) res = gst_pad_query_default (pad, query); break; } + gst_object_unref (wav); return res; } static gboolean gst_wavparse_srcpad_event (GstPad * pad, GstEvent * event) { - GstWavParse *wavparse = GST_WAVPARSE (GST_PAD_PARENT (pad)); - gboolean res = TRUE; + GstWavParse *wavparse = GST_WAVPARSE (gst_pad_get_parent (pad)); + gboolean res = FALSE; GST_DEBUG_OBJECT (wavparse, "event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); - /* can only handle events when we are in the data state */ - if (wavparse->state != GST_WAVPARSE_DATA) - return FALSE; - switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: - { - res = gst_wavparse_perform_seek (wavparse, event); + /* can only handle events when we are in the data state */ + if (wavparse->state != GST_WAVPARSE_DATA) { + res = gst_wavparse_perform_seek (wavparse, event); + } gst_event_unref (event); break; - } default: res = gst_pad_push_event (wavparse->sinkpad, event); break; } + gst_object_unref (wavparse); return res; } |