[FFmpeg-cvslog] r12127 - trunk/configure

Rich Felker dalias
Sun Feb 17 06:37:34 CET 2008


On Sun, Feb 17, 2008 at 01:00:07AM +0100, mru wrote:
> Author: mru
> Date: Sun Feb 17 01:00:06 2008
> New Revision: 12127
> 
> Log:
> prettify encoder/decoder/muxer/... list extraction
> 
> 
> Modified:
>    trunk/configure
> 
> Modified: trunk/configure
> ==============================================================================
> --- trunk/configure	(original)
> +++ trunk/configure	Sun Feb 17 01:00:06 2008
> @@ -949,15 +949,22 @@ fi
>  
>  FFMPEG_CONFIGURATION="$@"
>  
> -ENCODER_LIST=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
> -DECODER_LIST=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
> -PARSER_LIST=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
> -BSF_LIST=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' "$source_path/libavcodec/allcodecs.c"`
> -MUXER_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
> -DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
> -OUTDEV_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavdevice/alldevices.c"`
> -INDEV_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavdevice/alldevices.c"`
> -PROTOCOL_LIST=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' "$source_path/libavformat/allformats.c"`
> +find_things(){
> +    thing=$1
> +    pattern=$2
> +    file=$source_path/$3
> +    sed -n "s/^[^#]*$pattern.*(.*, *\\(.*\\)).*/\\1_$thing/p" "$file"
> +}
> +
> +ENCODER_LIST=$(find_things  encoder  ENC      libavcodec/allcodecs.c)
> +DECODER_LIST=$(find_things  decoder  DEC      libavcodec/allcodecs.c)
> +PARSER_LIST=$(find_things   parser   PARSER   libavcodec/allcodecs.c)
> +BSF_LIST=$(find_things      bsf      BSF      libavcodec/allcodecs.c)
> +MUXER_LIST=$(find_things    muxer    _MUX     libavformat/allformats.c)
> +DEMUXER_LIST=$(find_things  demuxer  DEMUX    libavformat/allformats.c)
> +OUTDEV_LIST=$(find_things   muxer    _MUX     libavdevice/alldevices.c)
> +INDEV_LIST=$(find_things    demuxer  DEMUX    libavdevice/alldevices.c)
> +PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)

I'm not opposed to this change, but it did double the number of
forks/processes needed for this code. Modifying find_things to take an
argument telling the variable name to store the results into would
avoid the extra fork due to $(find_things ...).

Rich





More information about the ffmpeg-cvslog mailing list