summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-24 20:06:45 +0200
committerwm4 <wm4@nowhere>2013-08-24 20:07:05 +0200
commit554cd7c490136ad0375abcdf24bed1908a7bf548 (patch)
treeb1fbea4800c89fac68ad42c9233a0e54cab32631
parent20e2d74440921810fb610887aaee0a03e4016e78 (diff)
downloadmpv-554cd7c490136ad0375abcdf24bed1908a7bf548.tar.bz2
mpv-554cd7c490136ad0375abcdf24bed1908a7bf548.tar.xz
sd_lavc_conv: fix build with older ffmpeg/libav
Sigh...
-rw-r--r--sub/sd_lavc_conv.c17
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;