[FFmpeg-devel] [PATCH 1/6] avcodec/apng: Remove threading support

Donny Yang work at kota.moe
Tue Jun 2 17:49:21 CEST 2015


Each frame depends on the previous frame any way, and it will
cause bugs with frame disposal

Signed-off-by: Donny Yang <work at kota.moe>
---
 libavcodec/pngdec.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 2512799..2ea3e8b 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1224,17 +1224,10 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
     if (dst == src)
         return 0;
 
-    pdst->frame_id = psrc->frame_id;
-
     ff_thread_release_buffer(dst, &pdst->picture);
     if (psrc->picture.f->data[0] &&
         (ret = ff_thread_ref_frame(&pdst->picture, &psrc->picture)) < 0)
         return ret;
-    if (CONFIG_APNG_DECODER && dst->codec_id == AV_CODEC_ID_APNG) {
-        ff_thread_release_buffer(dst, &pdst->last_picture);
-        if (psrc->last_picture.f->data[0])
-            return ff_thread_ref_frame(&pdst->last_picture, &psrc->last_picture);
-    }
 
     return 0;
 }
@@ -1294,9 +1287,7 @@ AVCodec ff_apng_decoder = {
     .init           = png_dec_init,
     .close          = png_dec_end,
     .decode         = decode_frame_apng,
-    .init_thread_copy = ONLY_IF_THREADS_ENABLED(png_dec_init),
-    .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
-    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
+    .capabilities   = CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
 };
 #endif
 
-- 
2.4.0


More information about the ffmpeg-devel mailing list