Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann 2022-07-27 11:06:47 +02:00
commit 4c08c0b8b1
6 changed files with 46 additions and 16 deletions

3
NEWS
View File

@ -19,8 +19,11 @@ ver 0.24 (not yet released)
* remove Haiku support * remove Haiku support
ver 0.23.9 (not yet released) ver 0.23.9 (not yet released)
* decoder
- ffmpeg: support FFmpeg 5.1
* output * output
- pipewire: set app icon - pipewire: set app icon
* improve iconv detection
ver 0.23.8 (2022/07/09) ver 0.23.8 (2022/07/09)
* storage * storage

View File

@ -151,8 +151,8 @@ gme = CmakeProject(
) )
ffmpeg = FfmpegProject( ffmpeg = FfmpegProject(
'http://ffmpeg.org/releases/ffmpeg-5.0.1.tar.xz', 'http://ffmpeg.org/releases/ffmpeg-5.1.tar.xz',
'ef2efae259ce80a240de48ec85ecb062cecca26e4352ffb3fda562c21a93007b', '55eb6aab5ee235550fa54a33eaf8bf1b4ec66c01453182b12f6a993d75698b03',
'lib/libavcodec.a', 'lib/libavcodec.a',
[ [
'--disable-shared', '--enable-static', '--disable-shared', '--enable-static',
@ -166,7 +166,6 @@ ffmpeg = FfmpegProject(
'--disable-swscale', '--disable-swscale',
'--disable-postproc', '--disable-postproc',
'--disable-avfilter', '--disable-avfilter',
'--disable-lzo',
'--disable-faan', '--disable-faan',
'--disable-pixelutils', '--disable-pixelutils',
'--disable-network', '--disable-network',

View File

@ -520,9 +520,15 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
return; return;
} }
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
const unsigned channels = codec_context->ch_layout.nb_channels;
#else
const unsigned channels = codec_context->channels;
#endif
const auto audio_format = CheckAudioFormat(codec_context->sample_rate, const auto audio_format = CheckAudioFormat(codec_context->sample_rate,
sample_format, sample_format,
codec_context->channels); channels);
const SignedSongTime total_time = const SignedSongTime total_time =
av_stream.duration != (int64_t)AV_NOPTS_VALUE av_stream.duration != (int64_t)AV_NOPTS_VALUE
@ -632,10 +638,17 @@ FfmpegScanStream(AVFormatContext &format_context, TagHandler &handler)
AV_TIME_BASE_Q)); AV_TIME_BASE_Q));
const auto &codec_params = *stream.codecpar; const auto &codec_params = *stream.codecpar;
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
const unsigned channels = codec_params.ch_layout.nb_channels;
#else
const unsigned channels = codec_params.channels;
#endif
try { try {
handler.OnAudioFormat(CheckAudioFormat(codec_params.sample_rate, handler.OnAudioFormat(CheckAudioFormat(codec_params.sample_rate,
ffmpeg_sample_format(AVSampleFormat(codec_params.format)), ffmpeg_sample_format(AVSampleFormat(codec_params.format)),
codec_params.channels)); channels));
} catch (...) { } catch (...) {
} }

View File

@ -21,10 +21,13 @@
#define __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS
#include "FfmpegIo.hxx" #include "FfmpegIo.hxx"
#include "libavutil/mem.h"
#include "../DecoderAPI.hxx" #include "../DecoderAPI.hxx"
#include "input/InputStream.hxx" #include "input/InputStream.hxx"
extern "C" {
#include <libavutil/mem.h>
}
AvioStream::~AvioStream() AvioStream::~AvioStream()
{ {
if (io != nullptr) { if (io != nullptr) {

View File

@ -37,7 +37,11 @@ InterleaveFrame(const AVFrame &frame, FfmpegBuffer &buffer)
assert(frame.nb_samples > 0); assert(frame.nb_samples > 0);
const auto format = AVSampleFormat(frame.format); const auto format = AVSampleFormat(frame.format);
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
const unsigned channels = frame.ch_layout.nb_channels;
#else
const unsigned channels = frame.channels; const unsigned channels = frame.channels;
#endif
const std::size_t n_frames = frame.nb_samples; const std::size_t n_frames = frame.nb_samples;
int plane_size; int plane_size;

View File

@ -18,17 +18,25 @@ if icu_dep.found()
'Util.cxx', 'Util.cxx',
'Init.cxx', 'Init.cxx',
] ]
elif not get_option('iconv').disabled() else
# an installed iconv library will make the builtin iconv() unavailable, if meson.version().version_compare('>= 0.60')
# so search for the library first and pass it as (possible) dependency iconv_dep = dependency('iconv', required: get_option('iconv'))
iconv_dep = compiler.find_library('libiconv', required: false) conf.set('HAVE_ICONV', iconv_dep.found())
have_iconv = compiler.has_function('iconv', elif not get_option('iconv').disabled()
dependencies: iconv_dep, iconv_open_snippet = '''#include <iconv.h>
prefix : '#include <iconv.h>') int main() {
if not have_iconv and get_option('iconv').enabled() iconv_open("","");
error('iconv() not available') }'''
have_iconv = compiler.links(iconv_open_snippet, name: 'iconv_open')
if not have_iconv
iconv_dep = compiler.find_library('iconv', required: false)
have_iconv = compiler.links(iconv_open_snippet, dependencies: iconv_dep, name: 'iconv_open')
endif
if not have_iconv and get_option('iconv').enabled()
error('iconv() not available')
endif
conf.set('HAVE_ICONV', have_iconv)
endif endif
conf.set('HAVE_ICONV', have_iconv)
endif endif
icu = static_library( icu = static_library(