@@ -21,6 +21,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/opt.h"
#define SCREEN_ROWS 15
@@ -952,4 +953,5 @@ AVCodec ff_ccaption_decoder = {
.decode = decode,
.priv_class = &ccaption_dec_class,
.capabilities = AV_CODEC_CAP_DELAY,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -26,6 +26,7 @@
#include <time.h>
#include "ass.h"
+#include "internal.h"
#include "jacosub.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
@@ -202,4 +203,5 @@ AVCodec ff_jacosub_decoder = {
.decode = jacosub_decode_frame,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -31,6 +31,7 @@
#include "libavutil/bprint.h"
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
static int indexof(const char *s, int c)
{
@@ -377,4 +378,5 @@ AVCodec ff_microdvd_decoder = {
.decode = microdvd_decode_frame,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -28,6 +28,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "bytestream.h"
+#include "internal.h"
#define STYLE_FLAG_BOLD (1<<0)
#define STYLE_FLAG_ITALIC (1<<1)
@@ -593,4 +594,5 @@ AVCodec ff_movtext_decoder = {
.decode = mov_text_decode_frame,
.close = mov_text_decode_close,
.flush = mov_text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/bprint.h"
static int mpl2_event_to_ass(AVBPrint *buf, const char *p)
@@ -90,4 +91,5 @@ AVCodec ff_mpl2_decoder = {
.init = ff_ass_subtitle_header_default,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -26,6 +26,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
@@ -83,4 +84,5 @@ AVCodec ff_realtext_decoder = {
.init = ff_ass_subtitle_header_default,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -28,6 +28,7 @@
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "htmlsubtitles.h"
+#include "internal.h"
typedef struct {
AVBPrint source;
@@ -190,4 +191,5 @@ AVCodec ff_sami_decoder = {
.close = sami_close,
.decode = sami_decode_frame,
.flush = sami_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -26,6 +26,7 @@
#include "avcodec.h"
#include "ass.h"
#include "htmlsubtitles.h"
+#include "internal.h"
static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
const char *in, int x1, int y1, int x2, int y2)
@@ -96,6 +97,7 @@ AVCodec ff_srt_decoder = {
.decode = srt_decode_frame,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -109,5 +111,6 @@ AVCodec ff_subrip_decoder = {
.decode = srt_decode_frame,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -26,6 +26,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/bprint.h"
static int subviewer_event_to_ass(AVBPrint *buf, const char *p)
@@ -74,4 +75,5 @@ AVCodec ff_subviewer_decoder = {
.init = ff_ass_subtitle_header_default,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
@@ -25,6 +25,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
@@ -91,6 +92,7 @@ AVCodec ff_text_decoder = {
.init = ff_ass_subtitle_header_default,
.priv_class = &text_decoder_class,
.flush = text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -117,6 +119,7 @@ AVCodec ff_vplayer_decoder = {
.init = linebreak_init,
.priv_class = &vplayer_decoder_class,
.flush = text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -134,6 +137,7 @@ AVCodec ff_stl_decoder = {
.init = linebreak_init,
.priv_class = &stl_decoder_class,
.flush = text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -151,6 +155,7 @@ AVCodec ff_pjs_decoder = {
.init = linebreak_init,
.priv_class = &pjs_decoder_class,
.flush = text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -168,6 +173,7 @@ AVCodec ff_subviewer1_decoder = {
.init = linebreak_init,
.priv_class = &subviewer1_decoder_class,
.flush = text_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
#endif
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "ass.h"
+#include "internal.h"
#include "libavutil/bprint.h"
static const struct {
@@ -107,4 +108,5 @@ AVCodec ff_webvtt_decoder = {
.init = ff_ass_subtitle_header_default,
.flush = ff_ass_decoder_flush,
.priv_data_size = sizeof(FFASSDecoderContext),
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
ff_ass_subtitle_header_full() just uses av_asprintf() and is therefore thread-safe itself. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavcodec/ccaption_dec.c | 2 ++ libavcodec/jacosubdec.c | 2 ++ libavcodec/microdvddec.c | 2 ++ libavcodec/movtextdec.c | 2 ++ libavcodec/mpl2dec.c | 2 ++ libavcodec/realtextdec.c | 2 ++ libavcodec/samidec.c | 2 ++ libavcodec/srtdec.c | 3 +++ libavcodec/subviewerdec.c | 2 ++ libavcodec/textdec.c | 6 ++++++ libavcodec/webvttdec.c | 2 ++ 11 files changed, 27 insertions(+)