On Mon, Oct 24, 2011 at 08:13:44PM +0200, Nicolas George wrote:
> This patch includes some fixes by Carl Eugen Hoyos.
> 
> Signed-off-by: Nicolas George <[email protected]>
> ---
>  configure                |    5 ++
>  doc/general.texi         |    2 +
>  libavcodec/Makefile      |    1 +
>  libavcodec/allcodecs.c   |    1 +
>  libavcodec/libcelt_dec.c |  137 
> ++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 146 insertions(+), 0 deletions(-)
>  create mode 100644 libavcodec/libcelt_dec.c

A changelog update and libavcodec version bump are missing,
cf. the new formats checklist in the dev docs.

> --- a/configure
> +++ b/configure
> @@ -161,6 +161,7 @@ Configuration options:
>  External library support:
>    --enable-avisynth        enable reading of AVISynth script files [no]
>    --enable-bzlib           enable bzlib [autodetect]
> +  --enable-libcelt         enable CELT/Opus decoding via libcelt [no]
>    --enable-frei0r          enable frei0r video filtering
>    --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb 
> [no]
>    --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb 
> [no]

Place this below libcdio, there used to be some order in that list.

> @@ -2882,6 +2885,7 @@ check_mathfunc truncf
>  
>  # these are off by default, so fail if requested and not available
>  enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
> +enabled libcelt    && require libcelt celt/celt.h celt_decode -lcelt0
>  enabled frei0r     && { check_header frei0r.h || die "ERROR: frei0r.h header 
> not found"; }
>  enabled libdirac   && require_pkg_config dirac                          \
>      "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h"  \

order please

> @@ -3168,6 +3172,7 @@ echo "libdxva2 enabled          ${dxva2-no}"
>  echo "libva enabled             ${vaapi-no}"
>  echo "libvdpau enabled          ${vdpau-no}"
>  echo "AVISynth enabled          ${avisynth-no}"
> +echo "libcelt enabled           ${libcelt-no}"
>  echo "frei0r enabled            ${frei0r-no}"
>  echo "libcdio support           ${libcdio-no}"
>  echo "libdc1394 support         ${libdc1394-no}"

ditto

> --- /dev/null
> +++ b/libavcodec/libcelt_dec.c
> @@ -0,0 +1,137 @@
> +
> +#include <celt/celt.h>
> +#include <celt/celt_header.h>
> +#include "avcodec.h"
> +#include "libavutil/intreadwrite.h"

#include <celt/celt.h>
#include <celt/celt_header.h>

#include "libavutil/intreadwrite.h"
#include "avcodec.h"

> +static int ff_celt_error_to_averror(int err)
> +{
> +    switch(err) {

switch (

> +        case CELT_BAD_ARG:          return AVERROR(EINVAL);
> +#ifdef CELT_BUFFER_TOO_SMALL
> +        case CELT_BUFFER_TOO_SMALL: return AVERROR(ENOBUFS);
> +#endif
> +        case CELT_INTERNAL_ERROR:   return AVERROR(EFAULT);
> +        case CELT_CORRUPTED_DATA:   return AVERROR_INVALIDDATA;
> +        case CELT_UNIMPLEMENTED:    return AVERROR(ENOTSUP);
> +#ifdef ENOTRECOVERABLE
> +        case CELT_INVALID_STATE:    return AVERROR(ENOTRECOVERABLE);
> +#endif
> +        case CELT_ALLOC_FAIL:       return AVERROR(ENOMEM);
> +        default:                    return AVERROR(EINVAL);
> +    }

What's with those #ifdefs?

> +    if(c->extradata_size >= 8) {

if (

> +AVCodec ff_libcelt_decoder = {
> +    .name           = "libcelt",
> +    .type           = AVMEDIA_TYPE_AUDIO,
> +    .id             = CODEC_ID_CELT,
> +    .priv_data_size = sizeof(struct libcelt_context),
> +    .init           = libcelt_dec_init,
> +    .close          = libcelt_dec_close,
> +    .decode         = libcelt_dec_decode,
> +    .capabilities   = 0,
> +    .long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"),

Align the last '=' as well.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to