diff options
author | Arwed v. Merkatz <v.merkatz@gmx.net> | 2005-06-09 17:30:25 +0000 |
---|---|---|
committer | Arwed v. Merkatz <v.merkatz@gmx.net> | 2005-06-09 17:30:25 +0000 |
commit | 3070d110a32553b683a2795f9232bad0084c7429 (patch) | |
tree | 622a8c083a404161110565d8b467b13c07bda093 | |
parent | 8ca07a3f3a7a4de307e194c5598aac03e874b278 (diff) | |
download | gst-plugins-bad-3070d110a32553b683a2795f9232bad0084c7429.tar.gz gst-plugins-bad-3070d110a32553b683a2795f9232bad0084c7429.tar.bz2 gst-plugins-bad-3070d110a32553b683a2795f9232bad0084c7429.zip |
Fixed time query and added position query.
Original commit message from CVS:
Fixed time query and added position query.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gst/tta/gstttaparse.c | 24 |
2 files changed, 18 insertions, 12 deletions
@@ -1,5 +1,11 @@ 2005-06-09 Arwed v. Merkatz <v.merkatz@gmx.net> + * 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 <v.merkatz@gmx.net> + * configure.ac: Check for wavpack library. * ext/wavpack/Makefile.am: 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); } |