@@ -30,12 +30,14 @@
#include "htmlsubtitles.h"
typedef struct {
+ AVClass *class;
+ int readorder;
+ FFASSHeaderOptions common;
AVBPrint source;
AVBPrint content;
AVBPrint encoded_source;
AVBPrint encoded_content;
AVBPrint full;
- int readorder;
} SAMIContext;
static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
@@ -159,7 +161,7 @@ static av_cold int sami_init(AVCodecContext *avctx)
av_bprint_init(&sami->encoded_source, 0, 2048);
av_bprint_init(&sami->encoded_content, 0, 2048);
av_bprint_init(&sami->full, 0, 2048);
- return ff_ass_subtitle_header_default(avctx);
+ return ff_ass_subtitle_header_from_opts(avctx, &sami->common);
}
static av_cold int sami_close(AVCodecContext *avctx)
@@ -180,6 +182,8 @@ static void sami_flush(AVCodecContext *avctx)
sami->readorder = 0;
}
+ASS_GENERIC_CLASS(sami, SAMI)
+
AVCodec ff_sami_decoder = {
.name = "sami",
.long_name = NULL_IF_CONFIG_SMALL("SAMI subtitle"),
@@ -190,4 +194,5 @@ AVCodec ff_sami_decoder = {
.close = sami_close,
.decode = sami_decode_frame,
.flush = sami_flush,
+ .priv_class = &sami_decoder_class,
};