diff mbox series

[FFmpeg-devel,203/217] avcodec/movtextenc, srtenc, webvttenc: Mark encoders as init-threadsafe

Message ID 20201202042244.519127-69-andreas.rheinhardt@gmail.com
State Accepted
Commit 2a4cedace4d440978aa10757644f2f0f7a80be2f
Headers show
Series [FFmpeg-devel,01/45] avcodec/a64multienc: Fix memleak upon init failure
Related show

Checks

Context Check Description
andriy/x86 warning Failed to apply patch

Commit Message

Andreas Rheinhardt Dec. 2, 2020, 4:22 a.m. UTC
They all rely on ff_ass_split(), which does not have any static state.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/movtextenc.c | 2 +-
 libavcodec/srtenc.c     | 4 ++++
 libavcodec/webvttenc.c  | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 1bef21e0b9..8da98d61e1 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -731,5 +731,5 @@  AVCodec ff_movtext_encoder = {
     .init           = mov_text_encode_init,
     .encode_sub     = mov_text_encode_frame,
     .close          = mov_text_encode_close,
-    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };
diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c
index 655b65679e..1ec5e693ef 100644
--- a/libavcodec/srtenc.c
+++ b/libavcodec/srtenc.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/bprint.h"
 #include "ass_split.h"
 #include "ass.h"
+#include "internal.h"
 
 
 #define SRT_STACK_SIZE 64
@@ -314,6 +315,7 @@  AVCodec ff_srt_encoder = {
     .init           = srt_encode_init,
     .encode_sub     = srt_encode_frame,
     .close          = srt_encode_close,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
 
@@ -327,6 +329,7 @@  AVCodec ff_subrip_encoder = {
     .init           = srt_encode_init,
     .encode_sub     = srt_encode_frame,
     .close          = srt_encode_close,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
 
@@ -340,5 +343,6 @@  AVCodec ff_text_encoder = {
     .init           = srt_encode_init,
     .encode_sub     = text_encode_frame,
     .close          = srt_encode_close,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c
index febf6ee370..ed762f77e8 100644
--- a/libavcodec/webvttenc.c
+++ b/libavcodec/webvttenc.c
@@ -26,6 +26,7 @@ 
 #include "libavutil/bprint.h"
 #include "ass_split.h"
 #include "ass.h"
+#include "internal.h"
 
 #define WEBVTT_STACK_SIZE 64
 typedef struct {
@@ -233,4 +234,5 @@  AVCodec ff_webvtt_encoder = {
     .init           = webvtt_encode_init,
     .encode_sub     = webvtt_encode_frame,
     .close          = webvtt_encode_close,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };