1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

Improve compatibility with Libav 0.8.4 and ffmpeg 0.11.2

Libav 0.8.4 is ridiculously old (in relative terms), so I don't know
how many things are broken silently.

Encoding is disabled, because the required API hasn't been added yet.
(On the other hand, the old API can't be used in newer versions.)

This should improve compatibility with ffmpeg 0.11.2 as well, which
didn't define AV_CODEC_ID_SUBRIP yet.
This commit is contained in:
wm4 2012-11-14 02:31:57 +01:00
parent 94fc9f7558
commit 9fc682d46f
4 changed files with 17 additions and 2 deletions

View File

@ -26,6 +26,7 @@
#include <libavutil/common.h>
#include <libavutil/audioconvert.h>
#include "compat/libav.h"
#include "config.h"
#include "core/options.h"
#include "core/mp_common.h"

View File

@ -27,10 +27,14 @@
#define AV_CPU_FLAG_MMX2 AV_CPU_FLAG_MMXEXT
#endif
#if LIBAVUTIL_VERSION_MICRO < 100
#if (LIBAVUTIL_VERSION_MICRO < 100) || (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 53, 100))
#define AV_CODEC_ID_SUBRIP CODEC_ID_TEXT
#endif
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 27, 0)
#define av_get_packed_sample_fmt(x) (x)
#endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0)
#define avcodec_free_frame av_freep
#endif

11
configure vendored
View File

@ -2860,7 +2860,7 @@ echores "$_lcms2"
# Test with > against Libav 0.8 versions which will NOT work rather than
# specify minimum version, to allow (future) point releases to possibly work.
all_libav_libs="libavutil > 51.26.0:libavcodec > 54.00.0:libavformat > 53.20.0:libswscale >= 2.0.0"
all_libav_libs="libavutil > 51.22.0:libavcodec >= 53.35.0:libavformat > 53.20.0:libswscale >= 2.0.0"
echocheck "Libav ($all_libav_libs)"
if test "$ffmpeg" = auto ; then
IFS=":" # shell should not be used for programming
@ -2871,6 +2871,15 @@ fi
echores "yes"
echocheck "Libav 0.8 compatibility hack"
if test "$_encoding" = yes && $_pkg_config "libavcodec >= 54.0.0" ; then
echores "no"
else
_encoding=no
echores "yes"
fi
echocheck "libpostproc >= 52.0.0"
if test "$libpostproc" = auto ; then
libpostproc=no

View File

@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "compat/libav.h"
#include "core/mp_common.h"
#include "core/options.h"
#include "video/fmt-conversion.h"