On 02/16/2012 02:48 PM, Aneesh Dogra wrote:

> ---
> I did not bump lavc minor because the api is still declared unstable.
> 
>  Changelog               |    1 +
>  doc/general.texi        |    2 +-
>  libavcodec/Makefile     |    1 +
>  libavcodec/allcodecs.c  |    2 +-
>  libavcodec/sunrastenc.c |  227 
> +++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/img2.c      |    3 +-
>  6 files changed, 233 insertions(+), 3 deletions(-)
>  create mode 100644 libavcodec/sunrastenc.c
[...]
> +static av_cold int sunrast_encode_init(AVCodecContext *avctx)
> +{
> +    SUNRASTContext *s = avctx->priv_data;
> +
> +    switch (avctx->coder_type) {
> +    case FF_CODER_TYPE_RLE:
> +        s->type = RT_BYTE_ENCODED;
> +        break;
> +    case FF_CODER_TYPE_RAW:
> +        s->type = RT_STANDARD;
> +        break;
> +    default:
> +        av_log(avctx, AV_LOG_ERROR, "invalid coder_type\n");
> +        return AVERROR_INVALIDDATA;


return AVERROR(EINVAL)

> +    }
> +
> +    avctx->coded_frame            = &s->picture;
> +    avctx->coded_frame->key_frame = 1;
> +    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
> +    s->maptype                    = RMT_NONE;
> +    s->maplength                  = 0;
> +
> +    switch (avctx->pix_fmt) {
> +    case PIX_FMT_MONOWHITE:
> +        s->depth = 1;
> +        break;
> +    case PIX_FMT_PAL8 :
> +    case PIX_FMT_GRAY8:
> +        s->depth = 8;
> +        if (avctx->pix_fmt == PIX_FMT_PAL8) {
> +            s->maptype   = RMT_EQUAL_RGB;
> +            s->maplength = 3 * 256;
> +        }


you can move the PAL8 part to the PAL8 case and don't break before the
GRAY8 case.

The rest looks good.

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

Reply via email to