On Thu, Dec 08, 2011 at 02:51:05PM +0000, Mans Rullgard wrote:
> [...]
You beat me to it by seconds or so - I was preparing almost exactly
the same patch set and have almost identical changes locally :)
> --- a/libavcodec/cljr.c
> +++ b/libavcodec/cljr.c
> @@ -33,6 +33,17 @@ typedef struct CLJRContext{
>
> +static av_cold int common_init(AVCodecContext *avctx)
> +{
> + CLJRContext * const a = avctx->priv_data;
> +
> + avctx->coded_frame = (AVFrame*)&a->picture;
> + a->avctx = avctx;
> +
> + return 0;
> +}
> @@ -118,60 +157,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned
> char *buf, int buf_size,
> -
> -static av_cold void common_init(AVCodecContext *avctx){
> - CLJRContext * const a = avctx->priv_data;
>
> - avctx->coded_frame= (AVFrame*)&a->picture;
> - a->avctx= avctx;
> -}
Here and in the other functions you make slight changes. It does look
good to me, but the log message seems a bit inaccurate. Please mention
those changes in the log message.
> @@ -86,6 +97,34 @@ static int decode_frame(AVCodecContext *avctx,
>
> +static av_cold int decode_init(AVCodecContext *avctx)
> +{
> + avctx->pix_fmt = PIX_FMT_YUV411P;
> + return common_init(avctx);
> +}
> +
> +AVCodec ff_cljr_decoder = {
> + .name = "cljr",
> + .type = AVMEDIA_TYPE_VIDEO,
> + .id = CODEC_ID_CLJR,
> + .priv_data_size = sizeof(CLJRContext),
> + .init = decode_init,
> + .close = decode_end,
> + .decode = decode_frame,
> + .capabilities = CODEC_CAP_DR1,
> + .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
Maybe align this while you're at it...
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel