summaryrefslogtreecommitdiffstats
path: root/common
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 /common
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 'common')
-rw-r--r--common/av_log.c23
-rw-r--r--common/recorder.c2
2 files changed, 4 insertions, 21 deletions
diff --git a/common/av_log.c b/common/av_log.c
index 8b0cb09efa..d7df24e05c 100644
--- a/common/av_log.c
+++ b/common/av_log.c
@@ -35,6 +35,7 @@
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
+#include <libswresample/swresample.h>
#include <libswscale/swscale.h>
#include <libavfilter/avfilter.h>
@@ -42,18 +43,6 @@
#include <libavdevice/avdevice.h>
#endif
-#if HAVE_LIBAV
-#include <libavresample/avresample.h>
-#else
-#include <libswresample/swresample.h>
-#endif
-
-#if LIBAVCODEC_VERSION_MICRO >= 100
-#define LIB_PREFIX "ffmpeg"
-#else
-#define LIB_PREFIX "libav"
-#endif
-
// Needed because the av_log callback does not provide a library-safe message
// callback.
static pthread_mutex_t log_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -151,7 +140,7 @@ void init_libav(struct mpv_global *global)
pthread_mutex_lock(&log_lock);
if (!log_mpv_instance) {
log_mpv_instance = global;
- log_root = mp_log_new(NULL, global->log, LIB_PREFIX);
+ log_root = mp_log_new(NULL, global->log, "ffmpeg");
log_decaudio = mp_log_new(log_root, log_root, "audio");
log_decvideo = mp_log_new(log_root, log_root, "video");
log_demuxer = mp_log_new(log_root, log_root, "demuxer");
@@ -195,14 +184,10 @@ bool print_libav_versions(struct mp_log *log, int v)
{"libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()},
{"libswscale", LIBSWSCALE_VERSION_INT, swscale_version()},
{"libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()},
-#if HAVE_LIBAV
- {"libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()},
-#else
{"libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version()},
-#endif
};
- mp_msg(log, v, "%s library versions:\n", LIB_PREFIX);
+ mp_msg(log, v, "FFmpeg library versions:\n");
bool mismatch = false;
for (int n = 0; n < MP_ARRAY_SIZE(libs); n++) {
@@ -216,7 +201,7 @@ bool print_libav_versions(struct mp_log *log, int v)
mp_msg(log, v, "\n");
}
- mp_msg(log, v, "%s version: %s\n", LIB_PREFIX, av_version_info());
+ mp_msg(log, v, "FFmpeg version: %s\n", av_version_info());
return !mismatch;
}
diff --git a/common/recorder.c b/common/recorder.c
index 1af736a71d..58bf257883 100644
--- a/common/recorder.c
+++ b/common/recorder.c
@@ -91,14 +91,12 @@ static int add_stream(struct mp_recorder *priv, struct sh_stream *sh)
if (!avp)
return -1;
-#if LIBAVCODEC_VERSION_MICRO >= 100
// We don't know the delay, so make something up. If the format requires
// DTS, the result will probably be broken. FFmpeg provides nothing better
// yet (unless you demux with libavformat, which contains tons of hacks
// that try to determine a PTS).
if (!sh->codec->lav_codecpar)
avp->video_delay = 16;
-#endif
if (avp->codec_id == AV_CODEC_ID_NONE)
return -1;