From 3070d110a32553b683a2795f9232bad0084c7429 Mon Sep 17 00:00:00 2001 From: "Arwed v. Merkatz" Date: Thu, 9 Jun 2005 17:30:25 +0000 Subject: Fixed time query and added position query. Original commit message from CVS: Fixed time query and added position query. --- ChangeLog | 6 ++++++ gst/tta/gstttaparse.c | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1980bc3c..d102f25b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-06-09 Arwed v. Merkatz + + * gst/tta/gstttaparse.c: (gst_tta_src_query): + Fixed time query and added position query so totem can display current + and total time. + 2005-06-09 Arwed v. Merkatz * configure.ac: diff --git a/gst/tta/gstttaparse.c b/gst/tta/gstttaparse.c index 3509d359..b12f3769 100644 --- a/gst/tta/gstttaparse.c +++ b/gst/tta/gstttaparse.c @@ -134,19 +134,19 @@ gst_tta_src_query (GstPad * pad, GstQueryType type, { GstTtaParse *ttaparse = GST_TTA_PARSE (gst_pad_get_parent (pad)); - if (type == GST_QUERY_TOTAL) { - if (*format == GST_FORMAT_TIME) { - if ((ttaparse->data_length == 0) || (ttaparse->samplerate == 0)) { - *value = 0; - return FALSE; - } - *value = - ((gdouble) ttaparse->data_length / (gdouble) ttaparse->samplerate) * - GST_SECOND; - GST_DEBUG_OBJECT (ttaparse, "got queried for time, returned %lli", - *value); - return TRUE; + if ((type == GST_QUERY_TOTAL) && (*format == GST_FORMAT_TIME)) { + if ((ttaparse->data_length == 0) || (ttaparse->samplerate == 0)) { + *value = 0; + return FALSE; } + *value = + ((gdouble) ttaparse->data_length / (gdouble) ttaparse->samplerate) * + GST_SECOND; + GST_DEBUG_OBJECT (ttaparse, "got queried for time, returned %lli", *value); + return TRUE; + } else if ((type == GST_QUERY_POSITION) && (*format == GST_FORMAT_TIME)) { + *value = ttaparse->index[ttaparse->current_frame].time; + return TRUE; } else { return gst_pad_query_default (pad, type, format, value); } -- cgit v1.2.1