Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
VapourSynth: introduce build time configurable for the default value …
Browse files Browse the repository at this point in the history
…of cachedir

Signed-off-by: akarin <i@akarin.info>
  • Loading branch information
AkarinVS committed Jun 22, 2021
1 parent 935e7a5 commit e611793
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions VapourSynth/README
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
LWLibavSource(string source, int stream_index = -1, int threads = 0, int cache = 1, string cachefile = source + ".lwi",
int seek_mode = 0, int seek_threshold = 10, int dr = 0, int fpsnum = 0, int fpsden = 1,
int variable = 0, string format = "", int repeat = 1, int dominance = 0, string decoder = "", int prefer_hw = 0, int ff_loglevel = 0,
string cachedir = ".")
string cachedir = DEFAULT_CACHEDIR)
* This function uses libavcodec as video decoder and libavformat as demuxer.
[Arguments]
+ source
Expand Down Expand Up @@ -168,5 +168,5 @@
Same as 'prefer_hw' of LibavSMASHSource().
+ ff_loglevel (default : 0)
Same as 'ff_loglevel' of LibavSMASHSource().
+ cachedir (default : ".")
Create *.lwi file under this directory with names encoding the full path to avoid collisions. Set to "" to restore the previous behavior.
+ cachedir (default : DEFAULT_CACHEDIR)
Create *.lwi file under this directory with names encoding the full path to avoid collisions. Set to "" to restore the previous behavior (storing *.lwi along side the source video file).
2 changes: 1 addition & 1 deletion VapourSynth/lwlibav_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void VS_CC vs_lwlibavsource_create( const VSMap *in, VSMap *out, void *user_data
set_option_string( &index_file_path, NULL, "cachefile", in, vsapi );
set_option_string( &format, NULL, "format", in, vsapi );
set_option_string( &preferred_decoder_names, NULL, "decoder", in, vsapi );
set_option_string( &cache_dir, ".", "cachedir", in, vsapi );
set_option_string( &cache_dir, DEFAULT_CACHEDIR, "cachedir", in, vsapi );
set_preferred_decoder_names_on_buf( hp->preferred_decoder_names_buf, preferred_decoder_names );
/* Set options. */
lwlibav_option_t opt;
Expand Down
2 changes: 1 addition & 1 deletion VapourSynth/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project('L-SMASH-Works', 'c',
meson_version: '>=0.48.0'
)

add_project_arguments('-DXXH_INLINE_ALL', '-D_FILE_OFFSET_BITS=64', language: 'c')
add_project_arguments('-DXXH_INLINE_ALL', '-D_FILE_OFFSET_BITS=64', '-DDEFAULT_CACHEDIR=' + get_option('cachedir'), language: 'c')

sources = [
'libavsmash_source.c',
Expand Down
7 changes: 7 additions & 0 deletions VapourSynth/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -Dcachedir=val set the default value for the cachedir option. Examples:
# (1) "": store *.lwi along side the source video file (the previous behavior)
# (2) ".": store *.lwi at the current directory
# (3) "/tmp": store *.lwi at /tmp
# (4) getenv("TMPDIR") [Unix] or getenv("TEMP") [Windows]: store *.lwi at system temporary directory.
# If unspecified, the default value is "".
option('cachedir', type: 'string', value: '""', description: 'Default value for cachedir parameter, e.g. "" to store along side the source video file; "." to store at current working directory and getenv("TMPDIR") to use temporary directory')

0 comments on commit e611793

Please sign in to comment.