mirror of https://github.com/mpv-player/mpv
parent
20e2d74440
commit
554cd7c490
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue