@@ -30,15 +30,17 @@
typedef struct {
AVClass *class;
+ int readorder;
+ FFASSHeaderOptions common;
const char *linebreaks;
int keep_ass_markup;
- int readorder;
} TextContext;
#define OFFSET(x) offsetof(TextContext, x)
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "keep_ass_markup", "Set if ASS tags must be escaped", OFFSET(keep_ass_markup), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags=SD },
+ ASS_HEADER_AVOPTIONS(TextContext, common)
{ NULL }
};
@@ -88,7 +90,7 @@ AVCodec ff_text_decoder = {
.type = AVMEDIA_TYPE_SUBTITLE,
.id = AV_CODEC_ID_TEXT,
.decode = text_decode_frame,
- .init = ff_ass_subtitle_header_default,
+ .init = ff_ass_subtitle_header_options,
.priv_class = &text_decoder_class,
.flush = text_flush,
};
@@ -100,7 +102,7 @@ static int linebreak_init(AVCodecContext *avctx)
{
TextContext *text = avctx->priv_data;
text->linebreaks = "|";
- return ff_ass_subtitle_header_default(avctx);
+ return ff_ass_subtitle_header_from_opts(avctx, &text->common);
}
#if CONFIG_VPLAYER_DECODER