static const char *gf_filter_load_arg_config(GF_Filter *filter, const char *sec_name, const char *arg_name, const char *arg_val)
{
	char szArg[101];
	Bool gf_sys_has_filter_global_args();
	const char *opt;
	GF_FilterSession *session = filter->session;

	//look in global args
	if (gf_sys_has_filter_global_args()) {
		u32 alen = (u32) strlen(arg_name);
		u32 i, nb_args = gf_sys_get_argc();
		for (i=0; i<nb_args; i++) {
			u32 flen = 0;
			const char *per_filter;
			const char *o_arg, *arg = gf_sys_get_arg(i);
			if (arg[0]!='-') continue;
			if (arg[1]!='-') continue;

			arg += 2;
			o_arg = arg;
			per_filter = strchr(arg, '@');
			if (per_filter) {
				flen = (u32) (per_filter - arg);
				if (!flen || strncmp(filter->freg->name, arg, flen))
					continue;
				flen++;
				arg += flen;
			}

			if (!strncmp(arg, arg_name, alen)) {
				u32 len=0;
				char *sep = strchr(arg, '=');
				if (sep) {
					len = (u32) (sep - (arg));
				} else {
					len = (u32) strlen(arg);
				}
				if (len != alen) continue;
				strncpy(szArg, o_arg, 100);
				szArg[ MIN(flen + alen, 100) ] = 0;
				gf_fs_push_arg(session, szArg, 1, 0);

				if (sep) return sep+1;
				//no arg value means boolean true
				else return "true";
			}
		}
	}

	//look in config file
	opt = gf_opts_get_key(sec_name, arg_name);
	if (opt)
		return opt;

	//ifce (used by socket and keep MP4Client behavior: some options are set in MP4Client main apply them
	if (!strcmp(arg_name, "ifce")) {
		opt = gf_opts_get_key("core", "ifce");
		if (opt)
			return opt;
		return NULL;
	}

	return arg_val;
}
static const char *gf_filter_load_arg_config(GF_Filter *filter, const char *sec_name, const char *arg_name, const char *arg_val)
{
	char szArg[101];
	Bool gf_sys_has_filter_global_args();
	const char *opt;
	GF_FilterSession *session = filter->session;

	 
	if (gf_sys_has_filter_global_args()) {
		u32 alen = (u32) strlen(arg_name);
		u32 i, nb_args = gf_sys_get_argc();
		for (i=0; i<nb_args; i++) {
			u32 flen = 0;
			const char *per_filter;
			const char *o_arg, *arg = gf_sys_get_arg(i);
			if (arg[0]!='-') continue;
			if (arg[1]!='-') continue;

			arg += 2;
			o_arg = arg;
			per_filter = strchr(arg, '@');
			if (per_filter) {
				flen = (u32) (per_filter - arg);
				if (!flen || strncmp(filter->freg->name, arg, flen))
					continue;
				flen++;
				arg += flen;
			}

			if (!strncmp(arg, arg_name, alen)) {
				u32 len=0;
				char *sep = strchr(arg, '=');
				if (sep) {
					len = (u32) (sep - (arg));
				} else {
					len = (u32) strlen(arg);
				}
				if (len != alen) continue;
				strncpy(szArg, o_arg, 100);
				szArg[ MIN(flen + alen, 100) ] = 0;
				gf_fs_push_arg(session, szArg, 1, 0);

				if (sep) return sep+1;
				 
				else return "true";
			}
		}
	}

	 
	opt = gf_opts_get_key(sec_name, arg_name);
	if (opt)
		return opt;

	 
	if (!strcmp(arg_name, "ifce")) {
		opt = gf_opts_get_key("core", "ifce");
		if (opt)
			return opt;
		return NULL;
	}

	return arg_val;
}