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 D37A44A1C1 for ; Sun, 24 Mar 2024 11:36:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 869F468D35C; Sun, 24 Mar 2024 13:36:11 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E865468D22D for ; Sun, 24 Mar 2024 13:36:04 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=KrzkXYmG; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A76A8240DAC for ; Sun, 24 Mar 2024 12:36:04 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id mqooopnV7P7v for ; Sun, 24 Mar 2024 12:36:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711280163; bh=Rmmui1IeptQmVpAFf08dEIxwqUg+KToNAh+xVtVLKSs=; h=Subject:From:To:In-Reply-To:References:Date:From; b=KrzkXYmGlXx+Ykx6vqAkDJYRYLiyF8I0zPfaMbWBXAdxqNM5+tzYaouA7rUVZD/ZE jIU3ohvbzdBoG47qKmU9zmK7J56OUNVI1BXqSzpMX8boHgi3Y6YQv1Cflu28wQX4ma Y0s8w4bdOYXb8ZNHePAv29GfrF0CkSyUYnw5ZF5Xa4pFOQIm/T+VSMZ3Yc4Pgxk6FT tpk60OGjEXe2aRS+sCGm+f+by6AMfw089gkAmQLkY6ON81LhP+VlBeR7yu8hVtoWi8 ThuRBJIwyeUQ0/n0LG8ovCPT3WprS3JT/bIIP9NwL9fkA7Af7gJbgOFZTOIFMCyDIn FsS2Fkkz6ySvQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id B6DC52404AF for ; Sun, 24 Mar 2024 12:36:03 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 9417B1601B9; Sun, 24 Mar 2024 12:36:03 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20240324001100.GF6420@pb2> <20240324092917.12874-2-anton@khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Sun, 24 Mar 2024 12:36:03 +0100 Message-ID: <171128016358.7287.8221240781616310005@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v3 08/12] lavc/frame_thread_encoder: avoid assigning a whole AVCodecContext 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: , Reply-To: FFmpeg development discussions and patches 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: Quoting Andreas Rheinhardt (2024-03-24 12:25:53) > Anton Khirnov: > > It is highly unsafe, as AVCodecContext contains many allocated fields. > > Everything needed by worked threads should be covered by > > * routing through AVCodecParameters > > * av_opt_copy() > > * copying quantisation matrices manually > > > > avcodec_free_context() can now be used for per-thread contexts. > > So now we have to maintain a list of stuff to be copied just to avoid > this "unsafe" copying. Sounds worse to me. We have to maintain a list of stuff either way, the difference is that with my patch forgetting an item may result in some features not working, while with current code forgetting an item will typically cause a double free. -- 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".