[FFmpeg-cvslog] avcodec/libx264: remove FF_CODEC_CAP_INIT_THREADSAFE flag

Marton Balint git at videolan.org
Fri Nov 2 00:19:50 EET 2018


ffmpeg | branch: release/4.0 | Marton Balint <cus at passwd.hu> | Sat Oct 20 12:12:42 2018 +0200| [00e7e4b1880678d8df0a0627b77e92d36ff32f8f] | committer: Marton Balint

avcodec/libx264: remove FF_CODEC_CAP_INIT_THREADSAFE flag

Libx264 uses strtok which is not thread safe. Strtok is used in
x264_param_default_preset in param_apply_tune in x264/common/base.c.
Therefore the flag must be removed.

x264 fixed the issue, once the fix is pushed to stable, an #if can be added
to re-enable the flag based on X264_BUILD number.

Fixes ticket #7446.

Signed-off-by: Marton Balint <cus at passwd.hu>
(cherry picked from commit b02490a497009064b7f192802aa246aa0b6a4dad)

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

 libavcodec/libx264.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 12379ff763..801affe823 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -1053,8 +1053,7 @@ AVCodec ff_libx264_encoder = {
     .priv_class       = &x264_class,
     .defaults         = x264_defaults,
     .init_static_data = X264_init_static,
-    .caps_internal    = FF_CODEC_CAP_INIT_THREADSAFE |
-                        FF_CODEC_CAP_INIT_CLEANUP,
+    .caps_internal    = FF_CODEC_CAP_INIT_CLEANUP,
     .wrapper_name     = "libx264",
 };
 #endif
@@ -1105,8 +1104,7 @@ AVCodec ff_libx262_encoder = {
     .priv_class       = &X262_class,
     .defaults         = x264_defaults,
     .pix_fmts         = pix_fmts_8bit,
-    .caps_internal    = FF_CODEC_CAP_INIT_THREADSAFE |
-                        FF_CODEC_CAP_INIT_CLEANUP,
+    .caps_internal    = FF_CODEC_CAP_INIT_CLEANUP,
     .wrapper_name     = "libx264",
 };
 #endif



More information about the ffmpeg-cvslog mailing list