From 61ba220b60087b62410b6709005f8ddfbdd711d6 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 11 May 2017 11:45:15 +0200 Subject: Normalize device loop. --- bin/recv-gst-rtp-v-a | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin/recv-gst-rtp-v-a') diff --git a/bin/recv-gst-rtp-v-a b/bin/recv-gst-rtp-v-a index 2289d04..1da2106 100755 --- a/bin/recv-gst-rtp-v-a +++ b/bin/recv-gst-rtp-v-a @@ -4,8 +4,8 @@ set -e CAMIP=${CAMIP:-$1} # origin host - default: use multicast group -VCOUNT=${VCOUNT:-$2} # number of video stream(s) to display - default: 1 -ACOUNT=${ACOUNT:-$3} # number of audio stream(s) to play - default: 0 +VCOUNT=${VCOUNT:-${2:-1}} # number of video stream(s) to display - default: 1 +ACOUNT=${ACOUNT:-${3:-0}} # number of audio stream(s) to play - default: 0 VFORMAT=${VFORMAT:-$4} # H264 VP8 RAW - default: RAW AFORMAT=${AFORMAT:-$5} # AMR OPUS RAW - default: RAW VSINK=${VSINK:-autovideosink} @@ -76,5 +76,7 @@ stream() { gst-launch-1.0 -v \ rtpbin name=rtpbin latency=$NETLATENCY drop-on-latency=true \ - $(for i in $(seq "${VCOUNT:-1}"); do stream "$i" "$VCAPS" "$VDEC ! $VSINK"; done) \ - $(for j in $(seq "${ACOUNT:-0}"); do stream $((VCOUNT+j)) "$ACAPS" "$ADEC ! $ASINK buffer-time=$ABUFFERS"; done) + $(n=0;\ + for i in $(seq "$VCOUNT"); do n=$((n+1)); stream "$n" "$VCAPS" "$VDEC ! $VSINK"; done;\ + for i in $(seq "$ACOUNT"); do n=$((n+1)); stream "$n" "$ACAPS" "$ADEC ! $ASINK buffer-time=$ABUFFERS"; done;\ + ) -- cgit v1.2.3