spa: ffmpeg: remove libavformat dependency

`av_register_all()` is the only thing used from libavformat,
but that doesn't seem to be needed for codec enumeration,
so remove it, and call `avcodec_register_all()` instead
when libavcodec < 58.10.100.
This commit is contained in:
Barnabás Pőcze 2021-05-15 14:32:52 +02:00 committed by Wim Taymans
parent 3f567eeb56
commit 3baf3fcfec
4 changed files with 5 additions and 7 deletions

View file

@ -25,7 +25,6 @@ if not get_option('spa-plugins').disabled()
aptx_dep = dependency('libopenaptx', version : '< 0.2.1', required : get_option('bluez5-codec-aptx'))
fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5-codec-aac'))
avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg'))
avformat_dep = dependency('libavformat', required: get_option('ffmpeg'))
jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan'))
vulkan_headers = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep)

View file

@ -29,7 +29,6 @@
#include <spa/node/node.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
int spa_ffmpeg_dec_init(struct spa_handle *handle, const struct spa_dict *info,
const struct spa_support *support, uint32_t n_support);
@ -90,9 +89,9 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t
static struct spa_handle_factory f;
static char name[128];
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all();
#endif
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)
avcodec_register_all();
#endif
if (*index == 0) {
c = av_codec_next(NULL);

View file

@ -5,6 +5,6 @@ ffmpeg_sources = ['ffmpeg.c',
ffmpeglib = shared_library('spa-ffmpeg',
ffmpeg_sources,
include_directories : [spa_inc],
dependencies : [ avcodec_dep, avformat_dep ],
dependencies : [avcodec_dep],
install : true,
install_dir : spa_plugindir / 'ffmpeg')

View file

@ -14,7 +14,7 @@ if not get_option('audiotestsrc').disabled()
subdir('audiotestsrc')
endif
subdir('bluez5')
if avcodec_dep.found() and avformat_dep.found()
if avcodec_dep.found()
subdir('ffmpeg')
endif
if jack_dep.found()