Thread: Avisynth+
View Single Post
Old 24th January 2019, 11:08   #4412  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
My expierence is that AVS+ is much more efficient using the available memory.
Mine too.

Quote:
Is it possible to have an AVSValue with an ArraySize() of 0?
Yes.

FrameSel plugin, 2nd arg is array of frame numbers,
Quote:
env->AddFunction("FrameSel", "ci*[SCmd]s[Cmd]s[Show]b[Ver]b[Reject]b[Ordered]b[Debug]b[Extract]i", Create_FrameSel, 0);,
Code:
AVSValue __cdecl Create_FrameSel(AVSValue args, void* user_data, IScriptEnvironment* env) {
PClip		_child	= args[0].AsClip();						// Source Clip, No Default
AVSValue	_Frames	= args[1];								// Frames, Array of frame numbers as filter arguments
const char *_SCmd	= args[2].AsString(NULL);				// SCmd, Frames in string, defaults to NULL
const char *_Cmd	= args[3].AsString(NULL);				// Cmd, Frames Cmd File, defaults to NULL
bool		_show	= args[4].AsBool(false);				// show, show frame numbers
bool		_ver	= args[5].AsBool(false);				// ver, show version
bool		_reject = args[6].AsBool(false);				// Reject Mode
bool		_ordered= args[7].AsBool(true);					// ordered Mode
bool		_debug  = args[8].AsBool(false);				// debug
int 		_extract = args[9].AsInt(1);					// extract

	if(_SCmd && *_SCmd == '\0')		_SCmd=NULL;				// Convert user supplied "" to NULL
	if(_Cmd  && *_Cmd  == '\0')		_Cmd=NULL;				// Convert user supplied "" to NULL

//	if(_Cmd==NULL && _SCmd==NULL && _Frames.ArraySize()==0)
//		return _child;										// No frames specified at all, return orig clip as if no filter.

	return new FrameSel(_child,_Frames,_SCmd,_Cmd,_show,_ver,_reject,_ordered,_debug,_extract,env);
}
Above, is actually switched off (commented out), but still shows that you can have ArraySize==0 when no frames specified.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 24th January 2019 at 11:13.
StainlessS is offline