From: <bi...@fr...> - 2005-12-07 11:46:34
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: bilboed Date: Wed Dec 07 2005 03:46:27 PST Log message: * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header), (gst_qtdemux_add_stream): Memleak fixes. Send out EOS for valid reasons (couldn't pull_range() from upstream for example). Modified files: . : ChangeLog gst/qtdemux : qtdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.1914&r2=1.1915 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/qtdemux/qtdemux.c.diff?r1=1.99&r2=1.100 ====Begin Diffs==== Index: qtdemux.c =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/gst/qtdemux/qtdemux.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- qtdemux.c 6 Dec 2005 19:55:56 -0000 1.99 +++ qtdemux.c 7 Dec 2005 11:46:15 -0000 1.100 @@ -493,7 +493,7 @@ guint8 *data; guint32 length; guint32 fourcc; - GstBuffer *buf; + GstBuffer *buf = NULL; int offset; guint64 cur_offset; int size; @@ -507,13 +507,15 @@ case QTDEMUX_STATE_HEADER:{ if (gst_pad_pull_range (qtdemux->sinkpad, cur_offset, 16, &buf) != GST_FLOW_OK) - goto pause; + goto error; data = GST_BUFFER_DATA (buf); length = GST_READ_UINT32_BE (data); GST_DEBUG ("length %08x", length); fourcc = GST_READ_UINT32_LE (data + 4); GST_DEBUG ("atom type %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc)); + gst_buffer_unref (buf); + if (length == 0) { length = G_MAXUINT32; //gst_bytestream_length (qtdemux->bs) - cur_offset; } @@ -543,7 +545,7 @@ if (gst_pad_pull_range (qtdemux->sinkpad, cur_offset, length, &moov) != GST_FLOW_OK) - goto pause; + goto error; cur_offset += length; qtdemux->offset += length; @@ -621,7 +623,7 @@ buf = NULL; if (gst_pad_pull_range (qtdemux->sinkpad, offset, size, &buf) != GST_FLOW_OK) if (buf) { /* hum... FIXME changing framerate breaks horribly, better set @@ -672,7 +674,7 @@ gst_buffer_set_caps (buf, stream->caps); ret = gst_pad_push (stream->pad, buf); if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED) - goto pause; + goto error; GST_INFO ("pushing buffer on %" GST_PTR_FORMAT, stream->pad); @@ -686,9 +688,10 @@ return; -pause: - GST_LOG_OBJECT (qtdemux, "pausing task"); +error: + GST_LOG_OBJECT (qtdemux, "pausing task and sending EOS"); gst_pad_pause_task (qtdemux->sinkpad); + gst_pad_event_default (qtdemux->sinkpad, gst_event_new_eos ()); } @@ -722,11 +725,12 @@ gchar *caps; if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) { + GstPadTemplate *templ; gchar *name = g_strdup_printf ("video_%02d", qtdemux->n_video_streams); - stream->pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_qtdemux_videosrc_template), name); + templ = gst_static_pad_template_get (&gst_qtdemux_videosrc_template); + stream->pad = gst_pad_new_from_template (templ, name); + gst_object_unref (templ); g_free (name); stream->fps_n = stream->timescale; stream->fps_d = stream->samples[0].duration; @@ -771,7 +775,7 @@ gst_pad_set_caps (stream->pad, stream->caps); GST_DEBUG ("adding pad %s %p to qtdemux %p", - gst_pad_get_name (stream->pad), stream->pad, qtdemux); + GST_OBJECT_NAME (stream->pad), stream->pad, qtdemux); gst_element_add_pad (GST_ELEMENT (qtdemux), stream->pad); if (list) { gst_element_found_tags_for_pad (GST_ELEMENT (qtdemux), stream->pad, list); Index: ChangeLog RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.1914 retrieving revision 1.1915 diff -u -d -r1.1914 -r1.1915 --- ChangeLog 6 Dec 2005 19:55:48 -0000 1.1914 +++ ChangeLog 7 Dec 2005 11:46:14 -0000 1.1915 @@ -1,3 +1,11 @@ +2005-12-07 Edward Hervey <ed...@fl...> + * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header), + (gst_qtdemux_add_stream): + Memleak fixes. + Send out EOS for valid reasons (couldn't pull_range() from upstream + for example). 2005-12-06 Thomas Vander Stichele <thomas at apestaart dot org> * docs/plugins/gst-plugins-bad-plugins-undocumented.txt: |