The story.....

In the past ffms2 included a script for combining video and audio with FFmpegSource2(). I've pasted it below.
You could put the script in the Avisynth auto-loading plugin folder so the function is always available, but being a script, you can fiddle with the default values.

I'd like the audio to be automatically included when I use FFmpegSource2(). When the script below was running the show, changing "atrack = default(atrack,-2)" to "atrack = default(atrack,-1)" did the job. These days, the same functionality is included in the dll, but is it possible to create a simple auto-loading script that will change a default value in much the same way?

My current workaround is to change "function FFmpegSource2()" to "function FFmpegSource3()" in the script below and continue using it (with atrack,-1 as the default), so that way FFmpegSource3() opens the source with audio by default, while FFmpegSource2() from the dll doesn't..... for reasons I don't understand given the purpose of FFmpegSource2 is to combine the video and audio. Or is that a bad idea?

None of it's a big deal of course, but sometimes it's the little things..... and I'm curious. I might even learn something. Anyone know of a simple way to tell ffms2.dll I want FFmpegSource2() to include the audio by default?

Cheers.

Code:
function FFmpegSource2(string source, int "vtrack", int "atrack", bool "cache", \
    string "cachefile", int "fpsnum", int "fpsden", int "threads", \
    string "timecodes", int "seekmode", bool "overwrite", int "width", int "height", \
    string "resizer", string "colorspace", int "rffmode", int "adjustdelay", \
    bool "utf8", string "varprefix") {
    
    vtrack         = default(vtrack,-1)
    atrack        = default(atrack,-2)
    cache        = default(cache,true)
    cachefile    = default(cachefile,source+".ffindex")
    fpsnum        = default(fpsnum,-1)
    fpsden        = default(fpsden,1)
    threads        = default(threads,-1)
    timecodes    = default(timecodes,"")
    seekmode    = default(seekmode,1)
    overwrite    = default(overwrite,false)
    width        = default(width,-1)
    height        = default(height,-1)
    resizer        = default(resizer,"BICUBIC")
    colorspace    = default(colorspace,"")
    rffmode        = default(rffmode,0)
    adjustdelay    = default(adjustdelay,-1)
    utf8        = default(utf8,false)
    varprefix    = default(varprefix, "")
    
    ((cache == true) && (atrack <= -2)) ? ffindex(source=source, cachefile=cachefile, \
        indexmask=0, overwrite=overwrite, utf8=utf8) : (cache == true) ? ffindex(source=source, \
        cachefile=cachefile, indexmask=-1, overwrite=overwrite, utf8=utf8) : nop
    
    v = ffvideosource(source=source, track=vtrack, cache=cache, cachefile=cachefile, \
        fpsnum=fpsnum, fpsden=fpsden, threads=threads, timecodes=timecodes, \
        seekmode=seekmode, rffmode=rffmode, width=width, height=height, resizer=resizer, \
        colorspace=colorspace, utf8=utf8, varprefix=varprefix)
    
    a = (atrack <= -2) ? blankclip(audio_rate=0) : ffaudiosource(source=source, \
        track=atrack, cache=cache, cachefile=cachefile, adjustdelay=adjustdelay, \
        utf8=utf8, varprefix=varprefix)
    
    return audiodubex(v,a)
)