summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-16 15:14:55 +0100
committerwm4 <wm4@nowhere>2020-02-16 15:14:55 +0100
commit7d11eda72e90d7aa9df25127bd810aa7b191029c (patch)
tree5c474862236dc62d136fe44dfdf3737bc808b829 /sub
parenta4eb8f75c0644ce5cf7c0bcea6b3efd2a886027d (diff)
downloadmpv-7d11eda72e90d7aa9df25127bd810aa7b191029c.tar.bz2
mpv-7d11eda72e90d7aa9df25127bd810aa7b191029c.tar.xz
Remove remains of Libav compatibility
Libav seems rather dead: no release for 2 years, no new git commits in master for almost a year (with one exception ~6 months ago). From what I can tell, some developers resigned themselves to the horrifying idea to post patches to ffmpeg-devel instead, while the rest of the developers went on to greener pastures. Libav was a better project than FFmpeg. Unfortunately, FFmpeg won, because it managed to keep the name and website. Libav was pushed more and more into obscurity: while there was initially a big push for Libav, FFmpeg just remained "in place" and visible for most people. FFmpeg was slowly draining all manpower and energy from Libav. A big part of this was that FFmpeg stole code from Libav (regular merges of the entire Libav git tree), making it some sort of Frankenstein mirror of Libav, think decaying zombie with additional legs ("features") nailed to it. "Stealing" surely is the wrong word; I'm just aping the language that some of the FFmpeg members used to use. All that is in the past now, I'm probably the only person left who is annoyed by this, and with this commit I'm putting this decade long problem finally to an end. I just thought I'd express my annoyance about this fucking shitshow one last time. The most intrusive change in this commit is the resample filter, which originally used libavresample. Since the FFmpeg developer refused to enable libavresample by default for drama reasons, and the API was slightly different, so the filter used some big preprocessor mess to make it compatible to libswresample. All that falls away now. The simplification to the build system is also significant.
Diffstat (limited to 'sub')
-rw-r--r--sub/lavc_conv.c15
-rw-r--r--sub/sd_lavc.c4
2 files changed, 0 insertions, 19 deletions
diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c
index 4824344a19..d47b0c4c07 100644
--- a/sub/lavc_conv.c
+++ b/sub/lavc_conv.c
@@ -31,8 +31,6 @@
#include "misc/bstr.h"
#include "sd.h"
-#define HAVE_AV_WEBVTT (LIBAVCODEC_VERSION_MICRO >= 100)
-
struct lavc_conv {
struct mp_log *log;
AVCodecContext *avctx;
@@ -94,10 +92,8 @@ struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name,
av_dict_free(&opts);
// Documented as "set by libavcodec", but there is no other way
avctx->time_base = (AVRational) {1, 1000};
-#if LIBAVCODEC_VERSION_MICRO >= 100
avctx->pkt_timebase = avctx->time_base;
avctx->sub_charenc_mode = FF_SUB_CHARENC_MODE_IGNORE;
-#endif
priv->avctx = avctx;
priv->extradata = talloc_strndup(priv, avctx->subtitle_header,
avctx->subtitle_header_size);
@@ -117,8 +113,6 @@ char *lavc_conv_get_extradata(struct lavc_conv *priv)
return priv->extradata;
}
-#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.
@@ -220,15 +214,6 @@ static int parse_webvtt(AVPacket *in, AVPacket *pkt)
return 0;
}
-#else
-
-static int parse_webvtt(AVPacket *in, AVPacket *pkt)
-{
- return -1;
-}
-
-#endif
-
// Return a NULL-terminated list of ASS event lines and have
// the AVSubtitle display PTS and duration set to input
// double variables.
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 3febe023d6..3ae8fc8905 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -78,9 +78,7 @@ static int init(struct sd *sd)
// Supported codecs must be known to decode to paletted bitmaps
switch (cid) {
case AV_CODEC_ID_DVB_SUBTITLE:
-#if LIBAVCODEC_VERSION_MICRO >= 100
case AV_CODEC_ID_DVB_TELETEXT:
-#endif
case AV_CODEC_ID_HDMV_PGS_SUBTITLE:
case AV_CODEC_ID_XSUB:
case AV_CODEC_ID_DVD_SUBTITLE:
@@ -99,9 +97,7 @@ static int init(struct sd *sd)
goto error;
mp_lavc_set_extradata(ctx, sd->codec->extradata, sd->codec->extradata_size);
priv->pkt_timebase = mp_get_codec_timebase(sd->codec);
-#if LIBAVCODEC_VERSION_MICRO >= 100
ctx->pkt_timebase = priv->pkt_timebase;
-#endif
if (avcodec_open2(ctx, sub_codec, NULL) < 0)
goto error;
priv->avctx = ctx;