From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 59F4647772 for ; Sun, 22 Oct 2023 12:45:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3A4368C991; Sun, 22 Oct 2023 15:45:33 +0300 (EEST) Received: from shout01.mail.de (shout01.mail.de [62.201.172.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 97A3F68C69A for ; Sun, 22 Oct 2023 15:45:27 +0300 (EEST) Received: from postfix01.mail.de (postfix01.bt.mail.de [10.0.121.125]) by shout01.mail.de (Postfix) with ESMTP id E8138A05C7 for ; Sun, 22 Oct 2023 14:45:26 +0200 (CEST) Received: from smtp01.mail.de (smtp01.bt.mail.de [10.0.121.211]) by postfix01.mail.de (Postfix) with ESMTP id C8B778010F for ; Sun, 22 Oct 2023 14:45:26 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp01.mail.de (Postfix) with ESMTPSA id 952AF240FEA for ; Sun, 22 Oct 2023 14:45:26 +0200 (CEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Oct 2023 14:45:25 +0200 Message-Id: <20231022124525.96162-1-thilo.borgmann@mail.de> MIME-Version: 1.0 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1675 X-purgate-ID: 154282::1697978726-DBFFE6B4-13FAF90F/0/0 Subject: [FFmpeg-devel] [PATCH] lavc/webp: Remove frame threading X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Thilo Borgmann via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Thilo Borgmann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Revealed by the patch to support animated webp, the current frame threading implementation contains a data race. vp8_lossy_decode_frame() calls ff_vp8_decode_frame() wich calls ff_thread_finish_setup() to sync its internal slice threading. The race is happens because vp8_lossy_decode_frame() has to touch the AVCodecContext after it was passed to ff_vp8_decode_frame() and ff_thread_finish_setup() had been called. Therefore remove frame threading in webp and rely on slice threading in VP8 only. --- libavcodec/webp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 54b3fde6dc..cde91aa7bb 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -49,7 +49,6 @@ #include "decode.h" #include "exif.h" #include "get_bits.h" -#include "thread.h" #include "tiff_common.h" #include "vp8.h" @@ -570,7 +569,7 @@ static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role, img->frame->height = h; if (role == IMAGE_ROLE_ARGB && !img->is_alpha_primary) { - ret = ff_thread_get_buffer(s->avctx, img->frame, 0); + ret = ff_get_buffer(s->avctx, img->frame, 0); } else ret = av_frame_get_buffer(img->frame, 1); if (ret < 0) @@ -1564,6 +1563,6 @@ const FFCodec ff_webp_decoder = { .init = webp_decode_init, FF_CODEC_DECODE_CB(webp_decode_frame), .close = webp_decode_close, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_ICC_PROFILES, }; -- 2.37.1 (Apple Git-137.1) _______________________________________________ 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".