[MPlayer-dev-eng] [PATCH] amr support
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 28 13:11:14 CET 2004
Hi,
> Try2, now nonsense options are accepted and no checks if --enable
> Float version is preferred because it's default in ffmpeg
> +echocheck "amr narrowband"
> +if test "$_amr_nb" = auto ; then
> + if test -f libavcodec/amr_float/sp_dec.c ; then
> + if test "$_libavcodec" = yes ; then
> + _amr_nb=yes
> + _def_amr_nb='#define AMR_NB 1'
> + echores "$_amr_nb"
> + else
> + _def_amr_nb='#undef AMR_NB'
> + _amr_nb=no
> + echores "libavcodec (static) is required by amr_nb, sorry"
> + fi
> + else
> + _def_amr_nb='#undef AMR_NB'
> + _amr_nb=no
> + echores "$_amr_nb"
> + fi
> +else
> + if test "$_amr_nb" = yes ; then
> + _amr_nb=yes
> + _def_amr_nb='#define AMR_NB 1'
> + else
> + _def_amr_nb='#undef AMR_NB'
> + _amr_nb=no
> + fi
> + echores "$_amr_nb"
> +fi
You have almost the same code three times here, that is not good...
Better do: first autodetection, set _amr_nb to either yes or no.
Then check if it is yes or no and set _def_amr_nr, echores etc appropriately.
I'd also suggest to print the "libavcodec (static) is required" message always if
you really want it to be there and not make an extra if for it.
Also your indentation is not consistent.
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list