From 0356f09ec0ee7ecd2f48b6de44d981bcfbfa0a7c Mon Sep 17 00:00:00 2001 From: Thomas Hirschberger Date: Tue, 23 May 2023 20:01:40 +0200 Subject: [PATCH] the vlcWrapper.bash and vlcPaWrapper.bash support adding custom options now --- scripts/vlcPaWrapper.bash | 12 +++++++++++- scripts/vlcWrapper.bash | 9 ++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/vlcPaWrapper.bash b/scripts/vlcPaWrapper.bash index 5de1d2e..7b5ef6b 100755 --- a/scripts/vlcPaWrapper.bash +++ b/scripts/vlcPaWrapper.bash @@ -29,13 +29,23 @@ trap exit_script exit NEW_VOLUME=$1 STREAM=$2 + +ADD_ARG_CNT=$(($#-2)) +if [ ${ADD_ARG_CNT} -gt 0 ] +then + ADD_OPTS=${@:3:$ADD_ARG_CNT} +else + ADD_OPTS="" +fi + + IDENTIFIER="video" #FILE_PATH=`readlink -f $0` #CUR_DIR=`dirname $FILE_PATH` PA_VOLUME="/usr/local/sbin/pa_volume" "$PA_VOLUME" "$IDENTIFIER" "$NEW_VOLUME" -/usr/bin/vlc -vvv -I dummy "$STREAM" vlc://quit 2>&1 & +/usr/bin/vlc -vvv ${ADD_OPTS} -I dummy "$STREAM" vlc://quit 2>&1 & sleep 1 VLC_PID=$! echo "PID is $VLC_PID" diff --git a/scripts/vlcWrapper.bash b/scripts/vlcWrapper.bash index 7d8591f..8a3844e 100755 --- a/scripts/vlcWrapper.bash +++ b/scripts/vlcWrapper.bash @@ -19,8 +19,15 @@ exit_script() { trap exit_script exit STREAM=$1 +ADD_ARG_CNT=$(($#-1)) +if [ ${ADD_ARG_CNT} -gt 0 ] +then + ADD_OPTS=${@:2:$ADD_ARG_CNT} +else + ADD_OPTS="" +fi -/usr/bin/vlc -vvv -I dummy "$STREAM" vlc://quit 2>&1 & +/usr/bin/vlc -vvv ${ADD_OPTS} -I dummy "$STREAM" vlc://quit 2>&1 & sleep 1 VLC_PID=$! echo "PID is $VLC_PID"