diff mbox series

[FFmpeg-devel,v3,3/3] avcodec/h264dec: Add FF_CODEC_CAP_INIT_CLEANUP

Message ID 1590554445-32387-1-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit b01d12bcc0fcebb2b5f06296d7a5c140cb30655b
Headers show
Series None | expand

Commit Message

Lance Wang May 27, 2020, 4:40 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/h264dec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Anton Khirnov May 27, 2020, 8:29 a.m. UTC | #1
Quoting lance.lmwang@gmail.com (2020-05-27 06:40:45)
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---

The patch looks ok, but it is really unclear why is there a third
version of this patch and what is different about it.
Lance Wang May 27, 2020, 10:26 a.m. UTC | #2
On Wed, May 27, 2020 at 10:29:21AM +0200, Anton Khirnov wrote:
> Quoting lance.lmwang@gmail.com (2020-05-27 06:40:45)
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> 
> The patch looks ok, but it is really unclear why is there a third
> version of this patch and what is different about it.

Sorry, I always scp the patch to other host for git send-mail and
notice it's the wrong version after got the mail. So please ignore
the old version.

> 
> -- 
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 47d7cbf..e463fde 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -228,7 +228,6 @@  int ff_h264_alloc_tables(H264Context *h)
     return 0;
 
 fail:
-    ff_h264_free_tables(h);
     return AVERROR(ENOMEM);
 }
 
@@ -420,7 +419,6 @@  static av_cold int h264_decode_init(AVCodecContext *avctx)
                av_log(avctx, explode ? AV_LOG_ERROR: AV_LOG_WARNING,
                       "Error decoding the extradata\n");
                if (explode) {
-                   h264_decode_end(avctx);
                    return ret;
                }
                ret = 0;
@@ -1107,7 +1105,7 @@  AVCodec ff_h264_decoder = {
                                NULL
                            },
     .caps_internal         = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING |
-                             FF_CODEC_CAP_ALLOCATE_PROGRESS,
+                             FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP,
     .flush                 = h264_decode_flush,
     .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
     .profiles              = NULL_IF_CONFIG_SMALL(ff_h264_profiles),