summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalvideowebencode22
1 files changed, 19 insertions, 3 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 59e88b7..3d6f952 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -387,9 +387,25 @@ if [ -n "$stereo$mono$silence" ]; then
| perl -ne 's/channels=// and print $_' || echo -1)
fi
# adapt channel count and flags to reflect actual downmix/silence need
-[ -z "$stereo" ] || [ $channels -le 2 ] || { stereo= && channels=2; }
-[ -z "$mono" ] || [ $channels -le 1 ] || { mono= && channels=1; }
-[ -z "$silence" ] || [ $channels -le 0 ] || { silence= && channels=0; }
+if [ -n "$stereo" ]; then
+ if [ $channels -gt 2 ]; then
+ channels=2
+ else
+ stereo=
+ fi
+elif [ -n "$mono" ]; then
+ if [ $channels -gt 1 ]; then
+ channels=1
+ else
+ mono=
+ fi
+elif [ -n "$silence" ]; then
+ if [ $channels -gt 0 ]; then
+ channels=0
+ else
+ silence=
+ fi
+fi
[ -z "$channels" ] || [ $channels -gt 0 ] || channels=
if [ -n "$stereo$mono$silence" ]; then
# melt cannot downmix with (stereo?) filters applied (bug#763911)