decoder/ffmpeg: require FFmpeg 4.0 or later

This commit is contained in:
Max Kellermann
2023-03-08 20:29:53 +01:00
parent dbfd0a833d
commit 598894211f
5 changed files with 5 additions and 25 deletions
-5
View File
@@ -59,13 +59,8 @@ public:
}
size_t Read(void *buffer, size_t size) {
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 81, 100)
int result = avio_read_partial(io_context,
(unsigned char *)buffer, size);
#else
int result = avio_read(io_context,
(unsigned char *)buffer, size);
#endif
if (result < 0)
throw MakeFfmpegError(result, "avio_read() failed");
+1 -6
View File
@@ -8,16 +8,11 @@
#include "LogCallback.hxx"
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/log.h>
}
void
FfmpegInit()
{
av_log_set_callback(FfmpegLogCallback);
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
/* deprecated as of FFmpeg 4.0 */
av_register_all();
#endif
}
+3 -3
View File
@@ -1,6 +1,6 @@
libavformat_dep = dependency('libavformat', version: '>= 57.40', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 57.48', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 55.27', required: get_option('ffmpeg'))
libavformat_dep = dependency('libavformat', version: '>= 58.12', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 58.18', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 56.14', required: get_option('ffmpeg'))
conf.set('HAVE_LIBAVUTIL', libavutil_dep.found())
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()