#include <stdio.h>
#include <glib.h>
#include <gst/gst.h>

int main()
{
	int i;
	guint64 t;
	/* pick an offset */
	guint64 offset = 10000;
	/* pick a sample rate */
	guint rate = 16384;

	for(i = 0; i < 20; i++) {
		/* convert offset to t */
		t = gst_util_uint64_scale_int(offset, GST_SECOND, rate);
		/* convert t to offset */
		offset = gst_util_uint64_scale_int(t, rate, GST_SECOND);
		/* display */
		printf("t = %lu, offset = %lu\n", t, offset);
	}
}
