View Single Post
Old 29th December 2011, 17:17   #29  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
Quote:
Originally Posted by vampiredom View Post
Only in cases where a .mp4 or .mov H.264 container is used. This is not needed for .mts files, for example.
Does the var isElementary something to do with that?

Quote:
Originally Posted by vampiredom View Post
I don't think so. As far as I know, there are no back-referenced variables possible in AviSynth. I wish there were!
What you mean by backreferences? Is that like getting more than one var out of function? I do it via string function followed by eval() if necessary
Quote:
When you try to load an AVI file.
Up to that point, the function is mostly just a bunch of string modifications and sanity-checking assertions and stuff.
But still, it should not clear my variables, right?




BTW: I happened to look at your SplitFilename and it might use some improvements. run this script for inspiration:
Code:
function ReplaceStr(string ss, string fnd, string rpl)
{pos=FindStr(ss,fnd)
(pos==0) ? ss : LeftStr(ss,pos-1)+rpl+ReplaceStr(MidStr(ss,pos+StrLen(fnd)),fnd,rpl)
}

BlankClip()
#srcfile="d:/ee\ff/Gggg.XxX"
#srcfile="Gggg.XxXxX"#0
#srcfile="h/h\h/h\Gggg.XxXxX"#2
srcfile="\h/h\h/h\Gggg.XxXxX"#1
#srcfile="d:\h/h\h/h\Gggg.XxXxX"
srcfiletmp=ReplaceStr(srcfile,"/","\")
bckslsh=FindStr(RevStr(srcfiletmp), "\") # bckslsh==1 means it's a dir which is not good, but won't check for this error now
filename=(bckslsh==0) ? srcfiletmp : RightStr(srcfiletmp,bckslsh-1)
ext=LCase(RightStr(filename,FindStr(RevStr(filename), ".")))
namebase=LeftStr(filename,StrLen(filename)-StrLen(ext))
basepath=LeftStr(srcfiletmp,StrLen(srcfiletmp)-StrLen(filename))
path  = (FindStr(srcfiletmp, ":")==2) ? basepath
    \ : (FindStr(srcfiletmp, "\")==1) ? LeftStr(GetWorkingDir(),2)+basepath
    \ :                              GetWorkingDir()+basepath
drive=LeftStr(path,2).UCase()
folder=MidStr(path,3)
Subtitle(srcfile+" = "+drive+"|"+folder+"|"+namebase+"|"+ext+"\n"+ srcfile+" = "+SplitFilename(srcfile,1)+"|"+SplitFilename(srcfile,2)+"|"+SplitFilename(srcfile,3)+"|"+SplitFilename(srcfile,4),lsp=1)
redfordxx is offline   Reply With Quote