
static s64 jsfio_tell(GF_FileIO *fileio)
{
	JSValue res;
	s64 ret;
	JSFileIOCtx *ioctx = gf_fileio_get_udta(fileio);
	if (!ioctx || !ioctx->gfio) return GF_BAD_PARAM;
	JSContext *ctx = ioctx->factory->ctx;
	gf_js_lock(ctx, GF_TRUE);
	res = JS_Call(ctx, ioctx->factory->tell, ioctx->js_obj, 0, NULL);
	JS_ToInt64(ctx, &ret, res);
	JS_FreeValue(ctx, res);
	gf_js_lock(ctx, GF_FALSE);
	return ret;

static s64 jsfio_tell(GF_FileIO *fileio)
{
	JSValue res;
	s64 ret;
	JSFileIOCtx *ioctx = gf_fileio_get_udta(fileio);
	if (!ioctx || !ioctx->gfio) return GF_BAD_PARAM;
	JSContext *ctx = ioctx->factory->ctx;
	gf_js_lock(ctx, GF_TRUE);
	res = JS_Call(ctx, ioctx->factory->tell, ioctx->js_obj, 0, NULL);
	JS_ToInt64(ctx, &ret, res);
	JS_FreeValue(ctx, res);
	gf_js_lock(ctx, GF_FALSE);
	return ret;