Skip to content

Commit

Permalink
Define DEBUG is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
glubsy committed May 14, 2021
1 parent 2385637 commit 6c65764
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions limited_autoload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__); \
Expand Down
9 changes: 8 additions & 1 deletion mpv_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=- --;
Expand Down

0 comments on commit 6c65764

Please sign in to comment.