diff mbox series

[FFmpeg-devel,1/3] avcodec/kmvc: Prefer in-band palette

Message ID 20210322020634.701593-1-andreas.rheinhardt@gmail.com
State Accepted
Commit fb6a8847ad60cd5d6f50d459743b46c23900d542
Headers show
Series [FFmpeg-devel,1/3] avcodec/kmvc: Prefer in-band palette | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 22, 2021, 2:06 a.m. UTC
Fixes decoding of https://samples.ffmpeg.org/V-codecs/KMVC/LOGO2.AVI

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/kmvc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Andreas Rheinhardt March 24, 2021, 12:45 a.m. UTC | #1
Andreas Rheinhardt:
> Fixes decoding of https://samples.ffmpeg.org/V-codecs/KMVC/LOGO2.AVI
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/kmvc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
> index cd9e32f443..8d9f0a9693 100644
> --- a/libavcodec/kmvc.c
> +++ b/libavcodec/kmvc.c
> @@ -275,6 +275,8 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
>      if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
>          return ret;
>  
> +    frame->palette_has_changed = ff_copy_palette(ctx->pal, avpkt, avctx);
> +
>      header = bytestream2_get_byte(&ctx->g);
>  
>      /* blocksize 127 is really palette change event */
> @@ -303,9 +305,6 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
>          }
>      }
>  
> -    if (ff_copy_palette(ctx->pal, avpkt, avctx))
> -        frame->palette_has_changed = 1;
> -
>      if (ctx->setpal) {
>          ctx->setpal = 0;
>          frame->palette_has_changed = 1;
> 
Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index cd9e32f443..8d9f0a9693 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -275,6 +275,8 @@  static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 
+    frame->palette_has_changed = ff_copy_palette(ctx->pal, avpkt, avctx);
+
     header = bytestream2_get_byte(&ctx->g);
 
     /* blocksize 127 is really palette change event */
@@ -303,9 +305,6 @@  static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
         }
     }
 
-    if (ff_copy_palette(ctx->pal, avpkt, avctx))
-        frame->palette_has_changed = 1;
-
     if (ctx->setpal) {
         ctx->setpal = 0;
         frame->palette_has_changed = 1;