diff options
author | wm4 <wm4@nowhere> | 2012-11-14 02:31:57 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-14 11:45:52 +0100 |
commit | 9fc682d46ff908556dcbd1ac78ed983f480976a5 (patch) | |
tree | b4085a2224200dea7a1009f6dbfbdd46fbd8da1d | |
parent | 94fc9f75584dad8a9aaef7a441ddf946c56bb311 (diff) | |
download | mpv-9fc682d46ff908556dcbd1ac78ed983f480976a5.tar.bz2 mpv-9fc682d46ff908556dcbd1ac78ed983f480976a5.tar.xz |
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.
-rw-r--r-- | audio/out/ao_lavc.c | 1 | ||||
-rw-r--r-- | compat/libav.h | 6 | ||||
-rwxr-xr-x | configure | 11 | ||||
-rw-r--r-- | video/out/vo_lavc.c | 1 |
4 files changed, 17 insertions, 2 deletions
diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index 08e1aa5555..c2fd2e6d63 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -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" diff --git a/compat/libav.h b/compat/libav.h index 54f0637749..6751fe9a39 100644 --- a/compat/libav.h +++ b/compat/libav.h @@ -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 @@ -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 diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index e502e57dd2..6a3bbddd26 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -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" |