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.
This commit is contained in:
Stefan Kost 2007-11-13 06:23:51 +00:00
parent 85ea09f143
commit 34c221a52f
2 changed files with 19 additions and 14 deletions

View file

@ -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>

View file

@ -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;
}