diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2006-02-11 13:54:26 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2006-02-11 13:54:26 +0000 |
commit | a28e6777bd4a856f8b197a99bf990e4e9ec5a924 (patch) | |
tree | 7e371c9e3c8e60613e95b73b0df4703696402ebe /gst/apetag | |
parent | a3e95ebfc9586534fa26d7ea59f34987f6e78ad1 (diff) |
gst/apetag/gsttagdemux.c: ... and fix the very same leaks in GstTagDemux.
Original commit message from CVS:
* gst/apetag/gsttagdemux.c: (gst_tag_demux_get_upstream_size),
(gst_tag_demux_do_typefind):
... and fix the very same leaks in GstTagDemux.
Diffstat (limited to 'gst/apetag')
-rw-r--r-- | gst/apetag/gsttagdemux.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/gst/apetag/gsttagdemux.c b/gst/apetag/gsttagdemux.c index 9bb43c88..c18ad21a 100644 --- a/gst/apetag/gsttagdemux.c +++ b/gst/apetag/gsttagdemux.c @@ -621,7 +621,6 @@ error: static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux) { - GstQuery *query; GstPad *peer = NULL; GstFormat format; gint64 result; @@ -634,21 +633,13 @@ gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux) if ((peer = gst_pad_get_peer (tagdemux->priv->sinkpad)) == NULL) return FALSE; - query = gst_query_new_duration (GST_FORMAT_BYTES); - gst_query_set_duration (query, GST_FORMAT_BYTES, -1); - - if (!gst_pad_query (peer, query)) - goto out; - - gst_query_parse_duration (query, &format, &result); - - if (format != GST_FORMAT_BYTES || result == -1) - goto out; - - tagdemux->priv->upstream_size = result; - res = TRUE; + format = GST_FORMAT_BYTES; + if (gst_pad_query_duration (peer, &format, &result) && + format == GST_FORMAT_BYTES && result > 0) { + tagdemux->priv->upstream_size = result; + res = TRUE; + } -out: gst_object_unref (peer); return res; } @@ -1319,6 +1310,7 @@ gst_tag_demux_do_typefind (GstTagDemux * tagdemux, GstBuffer * buffer) return find.caps; } + gst_caps_replace (&find.caps, NULL); return NULL; } |