diff options
Diffstat (limited to 'sub')
-rw-r--r-- | sub/sd_lavc_conv.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sub/sd_lavc_conv.c b/sub/sd_lavc_conv.c index ccfecbb00c..6f72671650 100644 --- a/sub/sd_lavc_conv.c +++ b/sub/sd_lavc_conv.c @@ -30,6 +30,12 @@ #include "mpvcore/bstr.h" #include "sd.h" +#if LIBAVCODEC_VERSION_MICRO >= 100 +#define HAVE_AV_WEBVTT (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 13, 100)) +#else +#define HAVE_AV_WEBVTT 0 +#endif + struct sd_lavc_priv { AVCodecContext *avctx; }; @@ -111,6 +117,8 @@ static int init(struct sd *sd) return -1; } +#if HAVE_AV_WEBVTT + // FFmpeg WebVTT packets are pre-parsed in some way. The FFmpeg Matroska // demuxer does this on its own. In order to free our demuxer_mkv.c from // codec-specific crud, we do this here. @@ -213,6 +221,15 @@ static int parse_webvtt(AVPacket *in, AVPacket *pkt) return 0; } +#else + +static int parse_webvtt(AVPacket *in, AVPacket *pkt) +{ + return -1; +} + +#endif + static void decode(struct sd *sd, struct demux_packet *packet) { struct sd_lavc_priv *priv = sd->priv; |