On Wed, Nov 30, 2011 at 10:23 AM, Thad Ward <[email protected]> wrote:
> ---
>  libavcodec/lagarith.c |   36 +++++++++++++++++++++++++-----------
>  1 files changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
> index 1aa9ec3..a8776e0 100644
> --- a/libavcodec/lagarith.c
> +++ b/libavcodec/lagarith.c
> @@ -447,7 +447,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
>     uint32_t offset_gu = 0, offset_bv = 0, offset_ry = 9;
>     int offs[4];
>     uint8_t *srcs[4], *dst;
> -    int i, j;
> +    int i, j, planes = 3;
>
>     AVFrame *picture = data;
>
> @@ -479,34 +479,42 @@ static int lag_decode_frame(AVCodecContext *avctx,
>         }
>         break;
>     case FRAME_ARITH_RGBA:
> -        avctx->pix_fmt = PIX_FMT_RGB32;
> +    case FRAME_ARITH_RGB24:
> +        if (frametype == FRAME_ARITH_RGB24) {
> +            avctx->pix_fmt = PIX_FMT_RGB24;
> +        } else if (frametype == FRAME_ARITH_RGBA) {

You can move this:

> +            avctx->pix_fmt = PIX_FMT_RGB32;
> +            planes = 4;
> +            offset_ry += 4;
> +            offs[3] = AV_RL32(buf + 9);

Under the FAME_ARITH_RGBA case. Which would eliminate the whole else
clause here.

> +        }

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

Reply via email to