[FFmpeg-cvslog] avcodec/pngenc: Mark encoders as init-threadsafe

Andreas Rheinhardt git at videolan.org
Tue May 11 01:21:12 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed May  5 20:50:16 2021 +0200| [413ec81ba8303468aca1c7c83bfd1118854987d0] | committer: Andreas Rheinhardt

avcodec/pngenc: Mark encoders as init-threadsafe

Initializing zlib in the way we do here is threadsafe, see
https://www.zlib.net/zlib_faq.html#faq21

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=413ec81ba8303468aca1c7c83bfd1118854987d0
---

 libavcodec/pngenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 831223be63..a398155100 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -1140,6 +1140,7 @@ const AVCodec ff_png_encoder = {
         AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
     },
     .priv_class     = &pngenc_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 
 const AVCodec ff_apng_encoder = {
@@ -1161,4 +1162,5 @@ const AVCodec ff_apng_encoder = {
         AV_PIX_FMT_NONE
     },
     .priv_class     = &apngenc_class,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };



More information about the ffmpeg-cvslog mailing list