diff mbox series

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

Message ID 20200125020200.2049-3-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/srtdec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index ecc0801595..8d3b3cfc9e 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -85,6 +85,8 @@  static int srt_decode_frame(AVCodecContext *avctx,
     return avpkt->size;
 }
 
+ASS_GENERIC_CLASS(srt, SubRip)
+
 #if CONFIG_SRT_DECODER
 /* deprecated decoder */
 AVCodec ff_srt_decoder = {
@@ -96,18 +98,22 @@  AVCodec ff_srt_decoder = {
     .decode       = srt_decode_frame,
     .flush        = ff_ass_decoder_flush,
     .priv_data_size = sizeof(FFASSDecoderContext),
+    .priv_class   = &srt_decoder_class,
 };
 #endif
 
+ASS_GENERIC_CLASS(subrip, SubRip)
+
 #if CONFIG_SUBRIP_DECODER
 AVCodec ff_subrip_decoder = {
     .name         = "subrip",
     .long_name    = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
     .type         = AVMEDIA_TYPE_SUBTITLE,
     .id           = AV_CODEC_ID_SUBRIP,
-    .init         = ff_ass_subtitle_header_default,
+    .init         = ff_ass_subtitle_header_options,
     .decode       = srt_decode_frame,
     .flush        = ff_ass_decoder_flush,
     .priv_data_size = sizeof(FFASSDecoderContext),
+    .priv_class   = &subrip_decoder_class,
 };
 #endif