Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann 2022-09-27 20:40:41 +02:00
commit 45599e7840
5 changed files with 26 additions and 10 deletions

2
NEWS
View File

@ -22,6 +22,8 @@ ver 0.24 (not yet released)
* remove Haiku support * remove Haiku support
ver 0.23.10 (not yet released) ver 0.23.10 (not yet released)
* encoder
- flac: fix failure when libFLAC is built without Ogg support
* Windows * Windows
- log to stdout by default, don't require "log_file" setting - log to stdout by default, don't require "log_file" setting

View File

@ -43,13 +43,15 @@ opus = AutotoolsProject(
) )
flac = AutotoolsProject( flac = AutotoolsProject(
'http://downloads.xiph.org/releases/flac/flac-1.3.4.tar.xz', 'http://downloads.xiph.org/releases/flac/flac-1.4.0.tar.xz',
'8ff0607e75a322dd7cd6ec48f4f225471404ae2730d0ea945127b1355155e737', 'af41c0733c93c237c3e52f64dd87e3b0d9af38259f1c7d11e8cbf583c48c2506',
'lib/libFLAC.a', 'lib/libFLAC.a',
[ [
'--disable-shared', '--enable-static', '--disable-shared', '--enable-static',
'--disable-stack-smash-protection',
'--disable-xmms-plugin', '--disable-cpplibs', '--disable-xmms-plugin', '--disable-cpplibs',
'--disable-doxygen-docs', '--disable-doxygen-docs',
'--disable-programs',
], ],
subdirs=['include', 'src/libFLAC'], subdirs=['include', 'src/libFLAC'],
) )
@ -445,7 +447,7 @@ jack = JackProject(
) )
boost = BoostProject( boost = BoostProject(
'https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2', 'https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2',
'475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39', '1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0',
'include/boost/version.hpp', 'include/boost/version.hpp',
) )

View File

@ -41,6 +41,7 @@ class FlacEncoder final : public Encoder {
FLAC__StreamEncoder *const fse; FLAC__StreamEncoder *const fse;
const unsigned compression; const unsigned compression;
const bool oggflac;
PcmBuffer expand_buffer; PcmBuffer expand_buffer;
@ -127,7 +128,7 @@ flac_encoder_init(const ConfigBlock &block)
} }
static void static void
flac_encoder_setup(FLAC__StreamEncoder *fse, unsigned compression, flac_encoder_setup(FLAC__StreamEncoder *fse, unsigned compression, bool oggflac,
const AudioFormat &audio_format) const AudioFormat &audio_format)
{ {
unsigned bits_per_sample; unsigned bits_per_sample;
@ -162,7 +163,7 @@ flac_encoder_setup(FLAC__StreamEncoder *fse, unsigned compression,
throw FormatRuntimeError("error setting flac sample rate to %d", throw FormatRuntimeError("error setting flac sample rate to %d",
audio_format.sample_rate); audio_format.sample_rate);
if (!FLAC__stream_encoder_set_ogg_serial_number(fse, if (oggflac && !FLAC__stream_encoder_set_ogg_serial_number(fse,
GenerateSerial())) GenerateSerial()))
throw FormatRuntimeError("error setting ogg serial number"); throw FormatRuntimeError("error setting ogg serial number");
} }
@ -170,11 +171,12 @@ flac_encoder_setup(FLAC__StreamEncoder *fse, unsigned compression,
FlacEncoder::FlacEncoder(AudioFormat _audio_format, FLAC__StreamEncoder *_fse, unsigned _compression, bool _oggflac, bool _oggchaining) FlacEncoder::FlacEncoder(AudioFormat _audio_format, FLAC__StreamEncoder *_fse, unsigned _compression, bool _oggflac, bool _oggchaining)
:Encoder(_oggchaining), :Encoder(_oggchaining),
audio_format(_audio_format), fse(_fse), audio_format(_audio_format), fse(_fse),
compression(_compression) compression(_compression),
oggflac(_oggflac)
{ {
/* this immediately outputs data through callback */ /* this immediately outputs data through callback */
auto init_status = _oggflac ? auto init_status = oggflac ?
FLAC__stream_encoder_init_ogg_stream(fse, FLAC__stream_encoder_init_ogg_stream(fse,
nullptr, WriteCallback, nullptr, WriteCallback,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
@ -213,7 +215,7 @@ PreparedFlacEncoder::Open(AudioFormat &audio_format)
throw std::runtime_error("FLAC__stream_encoder_new() failed"); throw std::runtime_error("FLAC__stream_encoder_new() failed");
try { try {
flac_encoder_setup(fse, compression, audio_format); flac_encoder_setup(fse, compression, oggflac, audio_format);
} catch (...) { } catch (...) {
FLAC__stream_encoder_delete(fse); FLAC__stream_encoder_delete(fse);
throw; throw;
@ -226,7 +228,7 @@ void
FlacEncoder::SendTag(const Tag &tag) FlacEncoder::SendTag(const Tag &tag)
{ {
/* re-initialize encoder since flac_encoder_finish resets everything */ /* re-initialize encoder since flac_encoder_finish resets everything */
flac_encoder_setup(fse, compression, audio_format); flac_encoder_setup(fse, compression, oggflac, audio_format);
FLAC__StreamMetadata *metadata = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); FLAC__StreamMetadata *metadata = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
FLAC__StreamMetadata_VorbisComment_Entry entry; FLAC__StreamMetadata_VorbisComment_Entry entry;

View File

@ -437,6 +437,8 @@ CurlInputStream::InitEasy()
request->SetVerifyPeer(verify_peer); request->SetVerifyPeer(verify_peer);
request->SetVerifyHost(verify_host); request->SetVerifyHost(verify_host);
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get()); request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
request->SetProxyVerifyPeer(verify_peer);
request->SetProxyVerifyHost(verify_host);
} }
void void

View File

@ -122,6 +122,14 @@ public:
easy.SetVerifyPeer(value); easy.SetVerifyPeer(value);
} }
void SetProxyVerifyHost(bool value) {
easy.SetOption(CURLOPT_PROXY_SSL_VERIFYHOST, value ? 2L : 0L);
}
void SetProxyVerifyPeer(bool value) {
easy.SetOption(CURLOPT_PROXY_SSL_VERIFYPEER, value);
}
void SetNoBody(bool value=true) { void SetNoBody(bool value=true) {
easy.SetNoBody(value); easy.SetNoBody(value);
} }