gst/avi/gstavidemux.c: Plug a little leak. Little code cleanups.

Original commit message from CVS:
* gst/avi/gstavidemux.c:
Plug a little leak. Little code cleanups.
This commit is contained in:
Stefan Kost 2007-09-10 06:49:32 +00:00
parent d1187f7120
commit 2d15f70302
2 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2007-09-10 Stefan Kost <ensonic@users.sf.net>
* gst/avi/gstavidemux.c:
Plug a little leak. Little code cleanups.
2007-09-09 Tim-Philipp Müller <tim at centricular dot net> 2007-09-09 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac: * configure.ac:

View file

@ -191,8 +191,8 @@ gst_avi_demux_init (GstAviDemux * avi)
gst_pad_set_activatepull_function (avi->sinkpad, gst_pad_set_activatepull_function (avi->sinkpad,
gst_avi_demux_sink_activate_pull); gst_avi_demux_sink_activate_pull);
gst_pad_set_activatepush_function (avi->sinkpad, gst_avi_demux_activate_push); gst_pad_set_activatepush_function (avi->sinkpad, gst_avi_demux_activate_push);
gst_element_add_pad (GST_ELEMENT (avi), avi->sinkpad);
gst_pad_set_chain_function (avi->sinkpad, gst_avi_demux_chain); gst_pad_set_chain_function (avi->sinkpad, gst_avi_demux_chain);
gst_element_add_pad (GST_ELEMENT (avi), avi->sinkpad);
avi->adapter = gst_adapter_new (); avi->adapter = gst_adapter_new ();
@ -216,6 +216,8 @@ gst_avi_demux_reset (GstAviDemux * avi)
{ {
gint i; gint i;
GST_DEBUG ("AVI: reset");
for (i = 0; i < avi->num_streams; i++) { for (i = 0; i < avi->num_streams; i++) {
g_free (avi->stream[i].strh); g_free (avi->stream[i].strh);
g_free (avi->stream[i].strf.data); g_free (avi->stream[i].strf.data);
@ -252,9 +254,10 @@ gst_avi_demux_reset (GstAviDemux * avi)
g_free (avi->avih); g_free (avi->avih);
avi->avih = NULL; avi->avih = NULL;
if (avi->seek_event) if (avi->seek_event) {
gst_event_unref (avi->seek_event); gst_event_unref (avi->seek_event);
avi->seek_event = NULL; avi->seek_event = NULL;
}
if (avi->globaltags) if (avi->globaltags)
gst_tag_list_free (avi->globaltags); gst_tag_list_free (avi->globaltags);
@ -1733,6 +1736,7 @@ gst_avi_demux_stream_index (GstAviDemux * avi,
GST_WARNING_OBJECT (avi, "skip LIST chunk, size %d", GST_WARNING_OBJECT (avi, "skip LIST chunk, size %d",
(8 + ((size + 1) & ~1))); (8 + ((size + 1) & ~1)));
offset += 8 + ((size + 1) & ~1); offset += 8 + ((size + 1) & ~1);
gst_buffer_unref (buf);
res = gst_pad_pull_range (avi->sinkpad, offset, 8, &buf); res = gst_pad_pull_range (avi->sinkpad, offset, 8, &buf);
if (res != GST_FLOW_OK) if (res != GST_FLOW_OK)
goto pull_failed; goto pull_failed;
@ -2507,8 +2511,7 @@ gst_avi_demux_push_event (GstAviDemux * avi, GstEvent * event)
avi_stream_context *stream = &avi->stream[i]; avi_stream_context *stream = &avi->stream[i];
if (stream->pad) { if (stream->pad) {
gst_event_ref (event); if (gst_pad_push_event (stream->pad, gst_event_ref (event)))
if (gst_pad_push_event (stream->pad, event))
result = TRUE; result = TRUE;
} }
} }