[FFmpeg-devel] [PATCH] configure: sort decoder/encoder/filter/... names in alphabet order in one page

Guo, Yejun yejun.guo at intel.com
Wed Apr 10 18:16:06 EEST 2019


takes decoder names an example, with the default page length, shell command
'pr' needs two pages for all the decoder names. The names are firstly printed
in the first page, then in the second page. So, as a whole, the names are
sorted neither in column order nor in row order. It's a little confused.

This patch calculates the proper page length, so all the names are printed
in one page, and so strictly in alphabet order, column by column.

Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
---
 configure | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index f6123f5..2eace26 100755
--- a/configure
+++ b/configure
@@ -3829,7 +3829,12 @@ die_unknown(){
 
 print_in_columns() {
     cols=$(expr $ncols / 24)
-    cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
+    if [ -n "$1" ]; then
+        page_length=$(expr \( $1 + $cols - 1 \) / $cols)
+        cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t -l $page_length
+    else
+        cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
+    fi
 }
 
 show_list() {
@@ -7134,7 +7139,8 @@ echo
 for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
     echo "Enabled ${type}s:"
     eval list=\$$(toupper $type)_LIST
-    print_enabled '_*' $list | print_in_columns
+    eanbled_list=`print_enabled '_*' $list`
+    echo $eanbled_list | print_in_columns `echo $eanbled_list | wc -w`
     echo
 done
 
-- 
2.7.4



More information about the ffmpeg-devel mailing list