diff options
author | wm4 <wm4@nowhere> | 2020-02-16 15:14:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-16 15:14:55 +0100 |
commit | 7d11eda72e90d7aa9df25127bd810aa7b191029c (patch) | |
tree | 5c474862236dc62d136fe44dfdf3737bc808b829 /filters/f_lavfi.c | |
parent | a4eb8f75c0644ce5cf7c0bcea6b3efd2a886027d (diff) | |
download | mpv-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 'filters/f_lavfi.c')
-rw-r--r-- | filters/f_lavfi.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c index db01e27e3e..18bad4b5f4 100644 --- a/filters/f_lavfi.c +++ b/filters/f_lavfi.c @@ -50,11 +50,6 @@ #include "filter_internal.h" #include "user_filters.h" -#if LIBAVFILTER_VERSION_MICRO < 100 -#define av_buffersink_get_frame_flags(a, b, c) av_buffersink_get_frame(a, b) -#define AV_BUFFERSINK_FLAG_NO_REQUEST 0 -#endif - struct lavfi { struct mp_log *log; struct mp_filter *f; @@ -529,13 +524,11 @@ error: static void dump_graph(struct lavfi *c) { -#if LIBAVFILTER_VERSION_MICRO >= 100 MP_DBG(c, "Filter graph:\n"); char *s = avfilter_graph_dump(c->graph, NULL); if (s) MP_DBG(c, "%s\n", s); av_free(s); -#endif } // Initialize the graph if all inputs have formats set. If it's already @@ -591,10 +584,7 @@ static bool feed_input_pads(struct lavfi *c) for (int n = 0; n < c->num_in_pads; n++) { struct lavfi_pad *pad = c->in_pads[n]; - bool requested = true; -#if LIBAVFILTER_VERSION_MICRO >= 100 - requested = av_buffersrc_get_nb_failed_requests(pad->buffer) > 0; -#endif + bool requested = av_buffersrc_get_nb_failed_requests(pad->buffer) > 0; // Always request a frame after EOF so that we can know if the EOF state // changes (e.g. for sparse streams with midstream EOF). @@ -705,9 +695,7 @@ static bool read_output_pads(struct lavfi *c) } if (r >= 0) { -#if LIBAVUTIL_VERSION_MICRO >= 100 mp_tags_copy_from_av_dictionary(pad->metadata, c->tmp_frame->metadata); -#endif struct mp_frame frame = mp_frame_from_av(pad->type, c->tmp_frame, &pad->timebase); if (c->emulate_audio_pts && frame.type == MP_FRAME_AUDIO) { @@ -807,12 +795,10 @@ static bool lavfi_command(struct mp_filter *f, struct mp_filter_command *cmd) return false; switch (cmd->type) { -#if LIBAVFILTER_VERSION_MICRO >= 100 case MP_FILTER_COMMAND_TEXT: { return avfilter_graph_send_command(c->graph, "all", cmd->cmd, cmd->arg, &(char){0}, 0, 0) >= 0; } -#endif case MP_FILTER_COMMAND_GET_META: { // We can worry later about what it should do to multi output filters. if (c->num_out_pads < 1) |