From 075f660a6a4171649e49232141b50f36fbe4c116 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 12 May 2005 19:48:45 +0000 Subject: [PATCH] ext/mad/: Fix mad and id3tag compilation again. Original commit message from CVS: * ext/mad/gstid3tag.c: (gst_id3_tag_src_query): * ext/mad/gstmad.c: (gst_mad_chain): Fix mad and id3tag compilation again. --- ChangeLog | 6 ++++++ ext/mad/gstid3tag.c | 45 ++++++++++++++++++--------------------------- ext/mad/gstmad.c | 4 ++-- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9d2b82..12c6272 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-05-12 Wim Taymans + * ext/mad/gstid3tag.c: (gst_id3_tag_src_query): + * ext/mad/gstmad.c: (gst_mad_chain): + Fix mad and id3tag compilation again. + +2005-05-12 Wim Taymans + * gst/udp/.cvsignore: * gst/udp/Makefile.am: * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_get_type), diff --git a/ext/mad/gstid3tag.c b/ext/mad/gstid3tag.c index fdf764c..ae6a520 100644 --- a/ext/mad/gstid3tag.c +++ b/ext/mad/gstid3tag.c @@ -163,8 +163,7 @@ static gboolean gst_id3_tag_src_event (GstPad * pad, GstEvent * event); static const GstEventMask *gst_id3_tag_get_event_masks (GstPad * pad); static const GstQueryType *gst_id3_tag_get_query_types (GstPad * pad); -static gboolean gst_id3_tag_src_query (GstPad * pad, - GstQueryType type, GstFormat * format, gint64 * value); +static gboolean gst_id3_tag_src_query (GstPad * pad, GstQuery * query); static gboolean gst_id3_tag_sink_event (GstPad * pad, GstEvent * event); static GstFlowReturn gst_id3_tag_chain (GstPad * pad, GstBuffer * buffer); @@ -429,43 +428,34 @@ gst_id3_tag_get_query_types (GstPad * pad) } static gboolean -gst_id3_tag_src_query (GstPad * pad, GstQueryType type, - GstFormat * format, gint64 * value) +gst_id3_tag_src_query (GstPad * pad, GstQuery * query) { gboolean res = FALSE; GstID3Tag *tag; tag = GST_ID3_TAG (gst_pad_get_parent (pad)); - switch (type) { - case GST_QUERY_TOTAL:{ - switch (*format) { + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_POSITION:{ + GstFormat format; + gint64 current, total; + + gst_query_parse_position (query, &format, NULL, NULL); + switch (format) { case GST_FORMAT_BYTES: if (GST_PAD_PEER (tag->sinkpad) && tag->state == GST_ID3_TAG_STATE_NORMAL && - gst_pad_query (GST_PAD_PEER (tag->sinkpad), GST_QUERY_TOTAL, - format, value)) { - *value -= tag->v2tag_size + tag->v1tag_size; - *value += tag->v2tag_size_new + tag->v1tag_size_new; - res = TRUE; - } - break; - default: - break; - } - break; - } - case GST_QUERY_POSITION: - switch (*format) { - case GST_FORMAT_BYTES: - if (GST_PAD_PEER (tag->sinkpad) && - gst_pad_query (GST_PAD_PEER (tag->sinkpad), GST_QUERY_POSITION, - format, value)) { + gst_pad_query_position (GST_PAD_PEER (tag->sinkpad), + &format, ¤t, &total)) { + total -= tag->v2tag_size + tag->v1tag_size; + total += tag->v2tag_size_new + tag->v1tag_size_new; if (tag->state == GST_ID3_TAG_STATE_NORMAL) { - *value -= tag->v2tag_size + tag->v2tag_size_new; + current -= tag->v2tag_size + tag->v2tag_size_new; } else { - *value = 0; + current = 0; } + gst_query_set_position (query, format, current, total); + res = TRUE; } break; @@ -473,6 +463,7 @@ gst_id3_tag_src_query (GstPad * pad, GstQueryType type, break; } break; + } default: break; } diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index 1f686db..246f41e 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -1494,8 +1494,8 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) if (GST_CLOCK_TIME_IS_VALID (mad->last_ts)) { GstFormat format = GST_FORMAT_DEFAULT; - gst_pad_convert (mad->srcpad, GST_FORMAT_TIME, mad->last_ts, &format, - &mad->total_samples); + gst_pad_query_convert (mad->srcpad, GST_FORMAT_TIME, mad->last_ts, + &format, &mad->total_samples); mad->last_ts = GST_CLOCK_TIME_NONE; } time_offset = mad->total_samples * GST_SECOND / mad->rate; -- 2.7.4