diff mbox series

[FFmpeg-devel,10/13] lavc/movtextdec: add support for configuring default style via AVOptions

Message ID 20200125020200.2049-10-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/13] lavc/ass: realign ff_ass_subtitle_header_default | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Ridley Combs Jan. 25, 2020, 2:01 a.m. UTC
---
 libavcodec/movtextdec.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index c38c5edce6..0bb03fc141 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -86,6 +86,9 @@  typedef struct {
 } TextWrapBox;
 
 typedef struct {
+    AVClass *class;
+    int readorder;
+    FFASSHeaderOptions common;
     StyleBox **s;
     StyleBox *s_temp;
     HighlightBox h;
@@ -99,7 +102,6 @@  typedef struct {
     uint64_t tracksize;
     int size_var;
     int count_s, count_f;
-    int readorder;
 } MovTextContext;
 
 typedef struct {
@@ -453,7 +455,7 @@  static int mov_text_init(AVCodecContext *avctx) {
                                 m->d.underline, ASS_DEFAULT_BORDERSTYLE,
                                 m->d.alignment);
     } else
-        return ff_ass_subtitle_header_default(avctx);
+        return ff_ass_subtitle_header_from_opts(avctx, &m->common);
 }
 
 static int mov_text_decode_frame(AVCodecContext *avctx,
@@ -567,6 +569,8 @@  static void mov_text_flush(AVCodecContext *avctx)
         m->readorder = 0;
 }
 
+ASS_GENERIC_CLASS(mov_text, "3GPP Timed Text")
+
 AVCodec ff_movtext_decoder = {
     .name         = "mov_text",
     .long_name    = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"),
@@ -577,4 +581,5 @@  AVCodec ff_movtext_decoder = {
     .decode       = mov_text_decode_frame,
     .close        = mov_text_decode_close,
     .flush        = mov_text_flush,
+    .priv_class   = &mov_text_decoder_class,
 };