summaryrefslogtreecommitdiffstats
path: root/gst/apetag
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-06-11 18:20:39 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-06-11 18:20:39 +0000
commit1a79337544f22d66a4de436ffd17a767cd45b73b (patch)
tree4bea1dd57f1441593acc087ac439846f5c49accb /gst/apetag
parent5a027ffd66994bc4f7c9b5103af3ed0c60f7503b (diff)
gst/: Use gst_pad_query_peer_duration() utility function here.
Original commit message from CVS: * gst/apetag/gsttagdemux.c: (gst_tag_demux_get_upstream_size): * gst/id3demux/gstid3demux.c: (id3demux_get_upstream_size): Use gst_pad_query_peer_duration() utility function here.
Diffstat (limited to 'gst/apetag')
-rw-r--r--gst/apetag/gsttagdemux.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gst/apetag/gsttagdemux.c b/gst/apetag/gsttagdemux.c
index 6e56b14a..ef9dc8c5 100644
--- a/gst/apetag/gsttagdemux.c
+++ b/gst/apetag/gsttagdemux.c
@@ -665,27 +665,21 @@ gst_tag_demux_sink_event (GstPad * pad, GstEvent * event)
static gboolean
gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux)
{
- GstPad *peer = NULL;
GstFormat format;
- gint64 result;
- gboolean res = FALSE;
+ gint64 len;
/* Short-cut if we already queried upstream */
if (tagdemux->priv->upstream_size > 0)
return TRUE;
- if ((peer = gst_pad_get_peer (tagdemux->priv->sinkpad)) == NULL)
- return FALSE;
-
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;
+ if (!gst_pad_query_peer_duration (tagdemux->priv->sinkpad, &format, &len) ||
+ len <= 0) {
+ return FALSE;
}
- gst_object_unref (peer);
- return res;
+ tagdemux->priv->upstream_size = len;
+ return TRUE;
}
static gboolean