[FFmpeg-devel,V1,5/5] lavf/webvttenc: fix ffmpeg -h full can't display webvtt muxer

Submitted by Jun Zhao on June 4, 2019, 5:38 a.m.

Details

Message ID 1559626724-16376-5-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao June 4, 2019, 5:38 a.m.
From: Jun Zhao <barryjzhao@tencent.com>

fix ffmpeg -h full can't display webvtt muxer

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

Patch hide | download patch | download mbox

diff --git a/libavformat/webvttenc.c b/libavformat/webvttenc.c
index 61b7f54..b4e8a61 100644
--- a/libavformat/webvttenc.c
+++ b/libavformat/webvttenc.c
@@ -26,6 +26,7 @@ 
 
 #include "avformat.h"
 #include "internal.h"
+#include "libavutil/opt.h"
 
 static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
 {
@@ -94,6 +95,17 @@  static int webvtt_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     return 0;
 }
 
+static const AVOption options[] = {
+    { NULL }
+};
+
+static const AVClass webvtt_muxer_class = {
+    .class_name  = "WebVTT muxer",
+    .item_name   = av_default_item_name,
+    .option      = options,
+    .version     = LIBAVUTIL_VERSION_INT,
+};
+
 AVOutputFormat ff_webvtt_muxer = {
     .name              = "webvtt",
     .long_name         = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -103,4 +115,5 @@  AVOutputFormat ff_webvtt_muxer = {
     .subtitle_codec    = AV_CODEC_ID_WEBVTT,
     .write_header      = webvtt_write_header,
     .write_packet      = webvtt_write_packet,
+    .priv_class        = &webvtt_muxer_class,
 };