diff mbox series

[FFmpeg-devel,12/13] lavc/libzvbi-teletextdec: add support for configuring default style via AVOptions

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

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

rcombs Jan. 25, 2020, 2:01 a.m. UTC
---
 libavcodec/libzvbi-teletextdec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c
index 3515f33924..018b350511 100644
--- a/libavcodec/libzvbi-teletextdec.c
+++ b/libavcodec/libzvbi-teletextdec.c
@@ -78,11 +78,14 @@  typedef struct TeletextContext
     int             last_pgno;
     int             last_p5;
     int             last_ass_alignment;
+
+    FFASSHeaderOptions common;
 } TeletextContext;
 
 static int my_ass_subtitle_header(AVCodecContext *avctx)
 {
-    int ret = ff_ass_subtitle_header_default(avctx);
+    TeletextContext *ctx = avctx->priv_data;
+    int ret = ff_ass_subtitle_header_from_opts(avctx, &ctx->common);
     char *new_header;
     uint8_t *event_pos;
 
@@ -756,7 +759,7 @@  static int teletext_init_decoder(AVCodecContext *avctx)
         case 0:
             return 0;
         case 1:
-            return ff_ass_subtitle_header_default(avctx);
+            return ff_ass_subtitle_header_from_opts(avctx, &ctx->common);
         case 2:
             return my_ass_subtitle_header(avctx);
     }
@@ -803,6 +806,7 @@  static const AVOption options[] = {
     {"txt_duration",    "display duration of teletext pages in msecs",       OFFSET(sub_duration),   AV_OPT_TYPE_INT,    {.i64 = -1},      -1, 86400000, SD},
     {"txt_transparent", "force transparent background of the teletext",      OFFSET(transparent_bg), AV_OPT_TYPE_INT,    {.i64 = 0},        0, 1,        SD},
     {"txt_opacity",     "set opacity of the transparent background",         OFFSET(opacity),        AV_OPT_TYPE_INT,    {.i64 = -1},      -1, 255,      SD},
+    ASS_HEADER_AVOPTIONS(TeletextContext, common)
     { NULL },
 };