All pastes #796858 Raw Edit

Stuff

public shellscript v1 · immutable
#796858 ·published 2007-11-25 14:45 UTC
rendered paste body
       if [[ -n $ID_AUDIO_ID ]]; then            O=$IFS IFS=$'\n' AUDIO_NCH=($(grep Audio: "$SCRATCH_FILE")) IFS=$O            for chn in ${!AUDIO_NCH[@]}; do                # TODO flesh this out with other possibilities: 7.1 etc                if grep -q 5:1 <<<  ${AUDIO_NCH[chn]}; then                    ID_AUDIO_NCH[chn]=6                elif grep -q channels <<< ${AUDIO_NCH[chn]}; then                    num_chn=$(sed -r 's/.* ([0-9]+) channels.*/\1/' \                    <<< ${AUDIO_NCH[chn]})                    if test_is_number "$num_chn"; then                        ID_AUDIO_NCH[chn]=$num_chn                    else                        ID_AUDIO_NCH[chn]=2                    fi                else                    ID_AUDIO_NCH[chn]=2                fi            done            ID_AUDIO_NCH=${ID_AUDIO_NCH[@]}            ID_AUDIO_NCH=${ID_AUDIO_NCH// /,}        fi