mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avcodec: Mark ff_ass_subtitle_header based decoders as 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>
This commit is contained in:
parent
a380343c75
commit
1c7e52f8ff
@ -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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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)
|
||||
@ -97,6 +98,7 @@ const 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
|
||||
|
||||
@ -110,5 +112,6 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user