diff mbox

[FFmpeg-devel,V2,3/4] lavc/webvttdec: fix ffmpeg -h full can't display webvtt decoder

Message ID 1559786846-30859-4-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao June 6, 2019, 2:07 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

fix ffmpeg -h full can't display webvtt decoder

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavcodec/webvttdec.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 7b2d175..28113f6 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -28,6 +28,7 @@ 
 #include "avcodec.h"
 #include "ass.h"
 #include "libavutil/bprint.h"
+#include "libavutil/opt.h"
 
 static const struct {
     const char *from;
@@ -98,6 +99,17 @@  static int webvtt_decode_frame(AVCodecContext *avctx,
     return avpkt->size;
 }
 
+static const AVOption options[] = {
+    { NULL },
+};
+
+static const AVClass webvtt_decoder_class = {
+    .class_name = "WebVTT decoder",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_webvtt_decoder = {
     .name           = "webvtt",
     .long_name      = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -107,4 +119,5 @@  AVCodec ff_webvtt_decoder = {
     .init           = ff_ass_subtitle_header_default,
     .flush          = ff_ass_decoder_flush,
     .priv_data_size = sizeof(FFASSDecoderContext),
+    .priv_class     = &webvtt_decoder_class,
 };