diff mbox series

[FFmpeg-devel] avcodec/mpegvideo_dec: properly set output frames as keyframes

Message ID 20230714123132.55249-1-jamrial@gmail.com
State Accepted
Commit e047d9c62bff5920074c516da966952cee20da66
Headers show
Series [FFmpeg-devel] avcodec/mpegvideo_dec: properly set output frames as keyframes | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer July 14, 2023, 12:31 p.m. UTC
Should fix ticket #10426.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/mpegvideo_dec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Ekström July 15, 2023, 5:40 p.m. UTC | #1
On Fri, Jul 14, 2023 at 3:32 PM James Almer <jamrial@gmail.com> wrote:
>
> Should fix ticket #10426.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/mpegvideo_dec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
> index fcca147cd6..670b0912e2 100644
> --- a/libavcodec/mpegvideo_dec.c
> +++ b/libavcodec/mpegvideo_dec.c
> @@ -344,9 +344,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
>
>      s->current_picture_ptr->f->pict_type = s->pict_type;
>      if (s->pict_type == AV_PICTURE_TYPE_I)
> -        s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
> +        s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_KEY;
>      else
> -        s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
> +        s->current_picture_ptr->f->flags &= ~AV_FRAME_FLAG_KEY;
>

Seems to fix the not-meant-to-happen switch from
`s->current_picture_ptr->f` to `s->current_picture.f` that occurred in
dc7bd7c5a5ad5ea800dfb63cc5dd15670d065527 .

Thus LGTM.

Jan
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index fcca147cd6..670b0912e2 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -344,9 +344,9 @@  FF_ENABLE_DEPRECATION_WARNINGS
 
     s->current_picture_ptr->f->pict_type = s->pict_type;
     if (s->pict_type == AV_PICTURE_TYPE_I)
-        s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
+        s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_KEY;
     else
-        s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
+        s->current_picture_ptr->f->flags &= ~AV_FRAME_FLAG_KEY;
 
     if ((ret = ff_mpeg_ref_picture(s->avctx, &s->current_picture,
                                    s->current_picture_ptr)) < 0)