[gst-devel] Re: [gst-cvs] thomasvs gstreamer: gstreamer/ gstreamer/gst/ gstreamer/gst/base/

Andy Wingo wingo at pobox.com
Tue Oct 11 02:19:51 CEST 2005


Hi Thomas,

On Mon, 2005-10-10 at 11:16 -0700, Thomas Vander Stichele wrote:

> --- gstbasesrc.c	7 Oct 2005 18:17:23 -0000	1.57
> +++ gstbasesrc.c	10 Oct 2005 18:16:37 -0000	1.58
> @@ -338,7 +338,7 @@
>          case GST_FORMAT_PERCENT:
>            b = gst_base_src_get_size (src, &ui64);
>            i64 = GST_FORMAT_PERCENT_MAX;
> -          i64 *= b ? (src->offset / (gdouble) ui64) : 1.0;
> +          i64 *= b ? (src->offset / gst_guint64_to_gdouble (ui64)) : 1.0;
>            gst_query_set_position (query, GST_FORMAT_PERCENT,
>                i64, GST_FORMAT_PERCENT_MAX);
>            return TRUE;

You sure this is worth the cost of adding API? It seems to me that this
case is adequately covered by gst_util_uint64_scale.

E.g.
if (b) {
 i64 = gst_util_uint64_scale (ui64, src->offset, ui64);
 i64 = G_CLAMP (i64, 0, GINT64_MAX);
}

Regards,

Wingo, who has an aversion to hacks





More information about the gstreamer-devel mailing list