decoder/ffmpeg: require FFmpeg 4.0 or later
This commit is contained in:
parent
dbfd0a833d
commit
598894211f
1
NEWS
1
NEWS
|
@ -15,6 +15,7 @@ ver 0.24 (not yet released)
|
||||||
- curl: add "connect_timeout" configuration
|
- curl: add "connect_timeout" configuration
|
||||||
- curl: fix busy loop after connection failed
|
- curl: fix busy loop after connection failed
|
||||||
* decoder
|
* decoder
|
||||||
|
- ffmpeg: require FFmpeg 4.0 or later
|
||||||
- hybrid_dsd: remove
|
- hybrid_dsd: remove
|
||||||
- opus: implement bitrate calculation
|
- opus: implement bitrate calculation
|
||||||
- wavpack: require libwavpack version 5
|
- wavpack: require libwavpack version 5
|
||||||
|
|
|
@ -452,12 +452,7 @@ FfmpegCheckTag(DecoderClient &client, InputStream *is,
|
||||||
static bool
|
static bool
|
||||||
IsSeekable(const AVFormatContext &format_context) noexcept
|
IsSeekable(const AVFormatContext &format_context) noexcept
|
||||||
{
|
{
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 6, 100)
|
|
||||||
return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) == 0;
|
return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) == 0;
|
||||||
#else
|
|
||||||
(void)format_context;
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -660,8 +655,6 @@ ffmpeg_scan_stream(InputStream &is, TagHandler &handler)
|
||||||
return FfmpegScanStream(*f, handler);
|
return FfmpegScanStream(*f, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ffmpeg_uri_decode(DecoderClient &client, const char *uri)
|
ffmpeg_uri_decode(DecoderClient &client, const char *uri)
|
||||||
{
|
{
|
||||||
|
@ -697,8 +690,6 @@ ffmpeg_protocols() noexcept
|
||||||
return protocols;
|
return protocols;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of extensions found for the formats supported by ffmpeg.
|
* A list of extensions found for the formats supported by ffmpeg.
|
||||||
* This list is current as of 02-23-09; To find out if there are more
|
* This list is current as of 02-23-09; To find out if there are more
|
||||||
|
@ -822,8 +813,6 @@ static const char *const ffmpeg_mime_types[] = {
|
||||||
constexpr DecoderPlugin ffmpeg_decoder_plugin =
|
constexpr DecoderPlugin ffmpeg_decoder_plugin =
|
||||||
DecoderPlugin("ffmpeg", ffmpeg_decode, ffmpeg_scan_stream)
|
DecoderPlugin("ffmpeg", ffmpeg_decode, ffmpeg_scan_stream)
|
||||||
.WithInit(ffmpeg_init, ffmpeg_finish)
|
.WithInit(ffmpeg_init, ffmpeg_finish)
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 9, 100)
|
|
||||||
.WithProtocols(ffmpeg_protocols, ffmpeg_uri_decode)
|
.WithProtocols(ffmpeg_protocols, ffmpeg_uri_decode)
|
||||||
#endif
|
|
||||||
.WithSuffixes(ffmpeg_suffixes)
|
.WithSuffixes(ffmpeg_suffixes)
|
||||||
.WithMimeTypes(ffmpeg_mime_types);
|
.WithMimeTypes(ffmpeg_mime_types);
|
||||||
|
|
|
@ -59,13 +59,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Read(void *buffer, size_t size) {
|
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,
|
int result = avio_read_partial(io_context,
|
||||||
(unsigned char *)buffer, size);
|
(unsigned char *)buffer, size);
|
||||||
#else
|
|
||||||
int result = avio_read(io_context,
|
|
||||||
(unsigned char *)buffer, size);
|
|
||||||
#endif
|
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
throw MakeFfmpegError(result, "avio_read() failed");
|
throw MakeFfmpegError(result, "avio_read() failed");
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,11 @@
|
||||||
#include "LogCallback.hxx"
|
#include "LogCallback.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavformat/avformat.h>
|
#include <libavutil/log.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FfmpegInit()
|
FfmpegInit()
|
||||||
{
|
{
|
||||||
av_log_set_callback(FfmpegLogCallback);
|
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
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
libavformat_dep = dependency('libavformat', version: '>= 57.40', required: get_option('ffmpeg'))
|
libavformat_dep = dependency('libavformat', version: '>= 58.12', required: get_option('ffmpeg'))
|
||||||
libavcodec_dep = dependency('libavcodec', version: '>= 57.48', required: get_option('ffmpeg'))
|
libavcodec_dep = dependency('libavcodec', version: '>= 58.18', required: get_option('ffmpeg'))
|
||||||
libavutil_dep = dependency('libavutil', version: '>= 55.27', required: get_option('ffmpeg'))
|
libavutil_dep = dependency('libavutil', version: '>= 56.14', required: get_option('ffmpeg'))
|
||||||
conf.set('HAVE_LIBAVUTIL', libavutil_dep.found())
|
conf.set('HAVE_LIBAVUTIL', libavutil_dep.found())
|
||||||
|
|
||||||
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
|
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
|
||||||
|
|
Loading…
Reference in New Issue