[FFmpeg-devel] [PATCH V5 1/2] configure: sort decoder/encoder/filter/... names in alphabet order

Guo, Yejun yejun.guo at intel.com
Wed Apr 24 16:36:54 EEST 2019


> 
> From: avih [mailto:avihpit at yahoo.com]
> Sent: Wednesday, April 24, 2019 9:22 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Cc: Guo, Yejun <yejun.guo at intel.com>
> Subject: Re: [FFmpeg-devel] [PATCH V5 1/2] configure: sort
> decoder/encoder/filter/... names in alphabet order
> 
> >  print_in_columns() {
> > -    cols=$(expr $ncols / 24)
> > -    cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
> > +    # the input should not contain chars such as '*',
> > +    # otherwise, '*' will be expanded to be all files in the current
> > +    # working directory which don't begin with a dot (`.`)
> > +    set -- $(tr ' ' '\n' | sort)
> > +    col_width=24
> > +    if [ $ncols -lt $col_width ]; then
> > +        col_width=$ncols
> > +    fi
> > +    cols=$(($ncols / $col_width))
> > +    rows=$(($(($# + $cols - 1)) / $cols))
> > +    cols_seq=$(seq $cols)
> > +    rows_seq=$(seq $rows)
> > +    for row in $rows_seq; do
> > +        print_index=$row
> > +        print_line=""
> > +        for col in $cols_seq; do
> > +            if [ $print_index -le $# ]; then
> > +                eval print_line='"$print_line "${'$print_index'}'
> > +            fi
> > +            print_index=$(($print_index + $rows))
> > +        done
> > +        printf "%-${col_width}s" $print_line
> > +        printf "\n"
> > +    done | sed 's/ *$//'
> > }
> 
> Looks good to me. No further comments (but I don't push).
> 
> Next time, know that you can use e.g. `$((x + y))` instead of `$(($x + $y))`,
> though in this case it doesn't matter and not worth another version.

got it, thanks.


More information about the ffmpeg-devel mailing list