summaryrefslogtreecommitdiffstats
path: root/gst/tta
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-10-19 15:58:01 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-10-19 15:58:01 +0000
commitf7d63a74e07e66b6871a6ae09b6de58ff625dbc6 (patch)
tree5c3875f1f5ff6a369707d94cecf025b1a5c3e188 /gst/tta
parent8d8b51648af85d0633cf76cc16c36f9682fcf99f (diff)
downloadgst-plugins-bad-f7d63a74e07e66b6871a6ae09b6de58ff625dbc6.tar.gz
gst-plugins-bad-f7d63a74e07e66b6871a6ae09b6de58ff625dbc6.tar.bz2
gst-plugins-bad-f7d63a74e07e66b6871a6ae09b6de58ff625dbc6.zip
gst/: API change fix.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_get_src_query_types), (gst_qtdemux_handle_src_query): * gst/speed/gstspeed.c: (speed_get_query_types), (speed_src_query): * gst/tta/gstttaparse.c: (gst_tta_parse_src_event), (gst_tta_parse_get_query_types), (gst_tta_parse_query): API change fix.
Diffstat (limited to 'gst/tta')
-rw-r--r--gst/tta/gstttaparse.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gst/tta/gstttaparse.c b/gst/tta/gstttaparse.c
index f6845a68..223b6657 100644
--- a/gst/tta/gstttaparse.c
+++ b/gst/tta/gstttaparse.c
@@ -238,6 +238,7 @@ gst_tta_parse_get_query_types (GstPad * pad)
{
static const GstQueryType types[] = {
GST_QUERY_POSITION,
+ GST_QUERY_DURATION,
0
};
@@ -253,23 +254,39 @@ gst_tta_parse_query (GstPad * pad, GstQuery * query)
case GST_QUERY_POSITION:
{
GstFormat format;
- gint64 cur, end;
+ gint64 cur;
- gst_query_parse_position (query, &format, NULL, NULL);
+ gst_query_parse_position (query, &format, NULL);
switch (format) {
case GST_FORMAT_TIME:
cur = ttaparse->index[ttaparse->current_frame].time;
+ break;
+ default:
+ format = GST_FORMAT_BYTES;
+ cur = ttaparse->index[ttaparse->current_frame].pos;
+ break;
+ }
+ gst_query_set_position (query, format, cur);
+ break;
+ }
+ case GST_QUERY_DURATION:
+ {
+ GstFormat format;
+ gint64 end;
+
+ gst_query_parse_duration (query, &format, NULL);
+ switch (format) {
+ case GST_FORMAT_TIME:
end = ((gdouble) ttaparse->data_length /
(gdouble) ttaparse->samplerate) * GST_SECOND;
break;
default:
format = GST_FORMAT_BYTES;
- cur = ttaparse->index[ttaparse->current_frame].pos;
end = ttaparse->index[ttaparse->num_frames].pos +
ttaparse->index[ttaparse->num_frames].size;
break;
}
- gst_query_set_position (query, format, cur, end);
+ gst_query_set_duration (query, format, end);
break;
}
default: