From 6c65764b43f684657d6a3f262f2a846381d9ff69 Mon Sep 17 00:00:00 2001 From: glubsy Date: Fri, 14 May 2021 05:07:09 +0200 Subject: [PATCH] Define DEBUG is not defined --- limited_autoload.c | 4 ++++ mpv_wrapper.sh | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/limited_autoload.c b/limited_autoload.c index ad1f464..303f6fd 100644 --- a/limited_autoload.c +++ b/limited_autoload.c @@ -23,6 +23,10 @@ // #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) // #undef __USE_MISC // DEBUG +#ifndef DEBUG +#define DEBUG 0 +#endif + #define debug_print(fmt, ...) \ do { if (DEBUG) {\ fprintf(stderr, "%d:%s(): ", __LINE__, __func__); \ diff --git a/mpv_wrapper.sh b/mpv_wrapper.sh index 7a973c1..528629e 100755 --- a/mpv_wrapper.sh +++ b/mpv_wrapper.sh @@ -42,6 +42,10 @@ while (( "$#" )); do PLAIN=1 shift ;; + -l|--limited) # use limited_autoload.so script + LIMITED=1 + shift + ;; -*|--*=) # unsupported flags echo "Error: Unsupported flag $1" >&2 exit 1 @@ -110,8 +114,11 @@ elif [[ "${PLAIN}" -eq 1 ]]; then #&& [[ ${#PARAMS[@]} -eq 1 ]]; then # PAR="${p}$'\n'${PAR}"; #done; # echo "DEBUG: PAR: ${PAR}"; + OPTIONS="--script-opts=limited_autoload-enabled=0"; mpv ${OPTIONS} ${PARAMS[@]}; - +elif [[ "${LIMITED}" -eq 1 ]]; then + OPTIONS="--script-opts=limited_autoload-enabled=1"; + mpv ${OPTIONS} ${PARAMS[@]}; else #echo "DEBUG:$FIND_CMD"; eval ${FIND_CMD}; eval ${FIND_CMD} | mpv ${OPTIONS} --playlist=- --;