diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-29 10:51:05 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-29 10:51:05 +0000 |
commit | 65277f763adcb68cea58abf75cd35eab450a0d15 (patch) | |
tree | ecbede5e2e057a3fcd5c996882354ad5f400c119 /media-libs/webrtc-audio-processing | |
parent | b20b0e862d577cc2f56ed09f5f833a80fd839d38 (diff) |
gentoo auto-resync : 29:11:2023 - 10:51:05
Diffstat (limited to 'media-libs/webrtc-audio-processing')
4 files changed, 392 insertions, 0 deletions
diff --git a/media-libs/webrtc-audio-processing/Manifest b/media-libs/webrtc-audio-processing/Manifest index 0cbe5496ae79..25e1d2cbe99f 100644 --- a/media-libs/webrtc-audio-processing/Manifest +++ b/media-libs/webrtc-audio-processing/Manifest @@ -1,9 +1,12 @@ AUX webrtc-audio-processing-0.3-Add-generic-byte-order-and-pointer-size-detection.patch 1125 BLAKE2B 5f9935ad20888444ab07cd4758d7ff0705a1fd14ea95c12e95a716cb3aa916ff21f3c6917acb24f8122051876838df9971cbd6936bdae757d55db9da57beed69 SHA512 a6f8ac5d178f2c27c0450c10948352eef5f0f9bb953f27f13904d16f7b6d5047c6ce6f2676f8727ea53aef0d834161da524929e872f18bb30c19dbc67dc35e6e AUX webrtc-audio-processing-0.3-big-endian-support.patch 3773 BLAKE2B 24170b27885261d397b07e603ed12aaaf5afd28d86150d62d452a78976cd791b7e40606effb4c125a7170784de6ebe7d6487fd1f8de72a6038c8c4a440d2d3c7 SHA512 65e68a26ef8953d901b96f4d48e6f976f8f18d4a48dafe5d065502910c611596b364519761db15187f3eb3c34256e6b237fcb2ae8e9c249e56f744fcf642f600 AUX webrtc-audio-processing-0.3-proper_detection_cxxabi_execinfo.patch 2251 BLAKE2B f534e6f58d86693d257fa653d92ca07db2c1d34b88fda3b112237cff99eed81252f4111d64070f96a4265dc2655896843dbbfa01785ed18c6ea10b0eec74aeb9 SHA512 592345960101a9538c6e1197bc8cb296ca0fb0f8c6b9b64f1f4fd906ae4a9c7e9e92de740bf6e1e38cc4efca7cab8265b59542ffcad5d04bb6f1abb399851f0f +AUX webrtc-audio-processing-1.3-Add-generic-byte-order-and-pointer-size-detection.patch 1105 BLAKE2B cc177fb92c5eba5276b8eb056dbbbb271f676b07f52ff78ff8b5d333c471b67f10d72c4d8a0a39463d6a7135da43f3056d29e9f0f9d324d1f6849f18e464498c SHA512 12670922dfaea74d168150fff1aef8ef7a2590751ba8f053a2c8ece9ef1d61bd6664fece1e37ccad07fe51fc40d3278fdca0b94bde952f28eb34ca7dfb428d4a +AUX webrtc-audio-processing-1.3-big-endian-support.patch 13688 BLAKE2B e2f6ee383f1b93e120c378590c7b72655d2320c79ffe8a876d072f4f4647ccc7f7da90a3a8247387108ab655c99aaf48becde8524b143b7cb8a412589d640f27 SHA512 fab640e876acfa2b015d160f6727cc6d4fe0eeeca8f6efa63af7c031f179231986f2abd6b12ae67bb1300736eef8ca222019dfe7228a91b4b71d91bf237f905c DIST webrtc-audio-processing-0.3.1.tar.xz 695920 BLAKE2B 833c6d12b358918d95dee5b165308c8cc382f98264349fd38649bfe478557765b85d9112a35194676ee52a8ef297fb7cb7e3a570d9c2295785b6fb97d35be948 SHA512 1c7a2d16f7f6c03cf6d60405d0dcd224caae6e80c9c4d43f8373bad2446affcdf49a02efb0085387328289aa79c8981dcaedff876cde55be9602dbde9c3f440b DIST webrtc-audio-processing-1.3.tar.gz 879768 BLAKE2B 3bf61e5b9eadde824deb26f0591a10651d3a593ad89d3c71408655a12407bf7ecf422fdef58e651fc31245f3b0d575869e3abb0abfcfcb2e1aea21c03cd79e82 SHA512 4f56cc0acfd93b5ae432bdf681151e91344cea3388107a3eee5f9b17261cf0f09779f8b0bb67b4d35582f1f54dadc236d059802e69447e994dd588506cac95df EBUILD webrtc-audio-processing-0.3.1-r1.ebuild 920 BLAKE2B b3e67c3488d2f9f90d3bee1c001f5aeaaa523e4ffb9b12abb451d86dc331e172f6e9c70f7b0832a237b05040a097d553d670633080d7e467ad008193cd7a596d SHA512 607beee8f25696c4e74af1bed53c6d30da692f395e1cd3fe88d864ae5d3cf16260f5636882a6206632e08e971fc9e9f284981262fa998f17b06e850f96479628 EBUILD webrtc-audio-processing-0.3.1.ebuild 780 BLAKE2B 9f39495c7189d7d35d7d246cd7a635d355b0fc65438c8a187b2529a2f54e1775fdad3fff0d2a61ceab3abdb4550342b007dc5e48758d20feaa8c7877cbb69f35 SHA512 b209145b656265c5b016b8ef2c22cbe3bf031230e6a3a84cdeb785c963c62e7cb4e144440c88c5c7b18d91b1ead8133752da5d40e86e3a015e4147e56f4aa0de EBUILD webrtc-audio-processing-1.3-r1.ebuild 709 BLAKE2B 9a92484f54423df99d622f3697258006777ed4cc915667816e42184973fa84bd0ff181fc4c5119b1a769b68e9c24e39a178edf7db0b1d357eb7f92fd03dcbe1e SHA512 8312eeeaf010a6dc7e23a5d12c34dcd913228d058df8f8da04b698245d850cde52977136c93df7af110e9f6bb6eb99971b71f897c574ba51bceea3511285dd4f +EBUILD webrtc-audio-processing-1.3-r2.ebuild 840 BLAKE2B 62028c589e644a60c8640818f216eb128fdd043abc96a4df18bdcd950645ae635bdefce9f4c626252920efe01a06b54310dd0be9a1962da69d2d893335437894 SHA512 6e72621e3617d2017972a15959b2be75cb927d8aeb9bf27d8a47e6c5ad5e8851564cce22f1fd973fb67a82b59b3dce99a142e43bfa8389917fadf82a4a9fad27 MISC metadata.xml 356 BLAKE2B 8852456f2e40daf7f1c67ba75e3df0f26512439b0bf1c56f85c648deeb62537b24600d49705c05f5f2afa9856d6f6d1accb5615e1a04a1a1a12bc035def7ac6b SHA512 1dbcf128eb2c1a714a822a953e05f4061fa3dc257a0bae2d8e8e9720085c5e9535f4f3373f025725f1c5ae088ab508ac97fb09e996c9fbeb5188196d15f82d3a diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-Add-generic-byte-order-and-pointer-size-detection.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-Add-generic-byte-order-and-pointer-size-detection.patch new file mode 100644 index 000000000000..e2d974afd976 --- /dev/null +++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-Add-generic-byte-order-and-pointer-size-detection.patch @@ -0,0 +1,32 @@ +https://bugs.gentoo.org/917493 +https://sources.debian.org/src/webrtc-audio-processing/1.0-0.2/debian/patches/Add-generic-byte-order-and-pointer-size-detection.patch/ + +Description: Add generic byte order and pointer size detection +Author: Than <than@redhat.com> +Origin: https://bugs.freedesktop.org/show_bug.cgi?id=95738#c4 +Last-Update: 2022-02-01 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/webrtc/rtc_base/system/arch.h ++++ b/webrtc/rtc_base/system/arch.h +@@ -58,7 +58,19 @@ + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN + #else +-#error Please add support for your architecture in rtc_base/system/arch.h ++/* instead of failing, use typical unix defines... */ ++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++#define WEBRTC_ARCH_BIG_ENDIAN ++#else ++#error __BYTE_ORDER__ is not defined ++#endif ++#if defined(__LP64__) ++#define WEBRTC_ARCH_64_BITS ++#else ++#define WEBRTC_ARCH_32_BITS ++#endif + #endif + + #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN)) diff --git a/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-big-endian-support.patch b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-big-endian-support.patch new file mode 100644 index 000000000000..3984cf70124c --- /dev/null +++ b/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-big-endian-support.patch @@ -0,0 +1,324 @@ +https://bugs.gentoo.org/917493 +https://sources.debian.org/src/webrtc-audio-processing/1.0-0.2/debian/patches/big-endian-support.patch/ + +Description: big endian support + Provide endianness converters before writing or after reading WAV +Author: Nicholas Guriev <nicholas@guriev.su> +Bug-telegram: https://github.com/desktop-app/tg_owt/pull/46 +Origin: https://github.com/desktop-app/tg_owt/commit/65f002e +Last-Update: 2022-02-01 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/webrtc/common_audio/wav_file.cc ++++ b/webrtc/common_audio/wav_file.cc +@@ -10,6 +10,7 @@ + + #include "common_audio/wav_file.h" + ++#include <byteswap.h> + #include <errno.h> + + #include <algorithm> +@@ -34,6 +35,38 @@ + format == WavFormat::kWavFormatIeeeFloat; + } + ++template <typename T> ++void TranslateEndianness(T* destination, const T* source, size_t length) { ++ static_assert(sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8, ++ "no converter, use integral types"); ++ if (sizeof(T) == 2) { ++ const uint16_t* src = reinterpret_cast<const uint16_t*>(source); ++ uint16_t* dst = reinterpret_cast<uint16_t*>(destination); ++ for (size_t index = 0; index < length; index++) { ++ dst[index] = bswap_16(src[index]); ++ } ++ } ++ if (sizeof(T) == 4) { ++ const uint32_t* src = reinterpret_cast<const uint32_t*>(source); ++ uint32_t* dst = reinterpret_cast<uint32_t*>(destination); ++ for (size_t index = 0; index < length; index++) { ++ dst[index] = bswap_32(src[index]); ++ } ++ } ++ if (sizeof(T) == 8) { ++ const uint64_t* src = reinterpret_cast<const uint64_t*>(source); ++ uint64_t* dst = reinterpret_cast<uint64_t*>(destination); ++ for (size_t index = 0; index < length; index++) { ++ dst[index] = bswap_64(src[index]); ++ } ++ } ++} ++ ++template <typename T> ++void TranslateEndianness(T* buffer, size_t length) { ++ TranslateEndianness(buffer, buffer, length); ++} ++ + // Doesn't take ownership of the file handle and won't close it. + class WavHeaderFileReader : public WavHeaderReader { + public: +@@ -89,10 +122,6 @@ + + size_t WavReader::ReadSamples(const size_t num_samples, + int16_t* const samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to big-endian when reading from WAV file" +-#endif +- + size_t num_samples_left_to_read = num_samples; + size_t next_chunk_start = 0; + while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { +@@ -105,6 +134,9 @@ + num_bytes_read = file_.Read(samples_to_convert.data(), + chunk_size * sizeof(samples_to_convert[0])); + num_samples_read = num_bytes_read / sizeof(samples_to_convert[0]); ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(samples_to_convert.data(), num_samples_read); ++#endif + + for (size_t j = 0; j < num_samples_read; ++j) { + samples[next_chunk_start + j] = FloatToS16(samples_to_convert[j]); +@@ -114,6 +146,10 @@ + num_bytes_read = file_.Read(&samples[next_chunk_start], + chunk_size * sizeof(samples[0])); + num_samples_read = num_bytes_read / sizeof(samples[0]); ++ ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(&samples[next_chunk_start], num_samples_read); ++#endif + } + RTC_CHECK(num_samples_read == 0 || (num_bytes_read % num_samples_read) == 0) + << "Corrupt file: file ended in the middle of a sample."; +@@ -129,10 +165,6 @@ + } + + size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to big-endian when reading from WAV file" +-#endif +- + size_t num_samples_left_to_read = num_samples; + size_t next_chunk_start = 0; + while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { +@@ -145,6 +177,9 @@ + num_bytes_read = file_.Read(samples_to_convert.data(), + chunk_size * sizeof(samples_to_convert[0])); + num_samples_read = num_bytes_read / sizeof(samples_to_convert[0]); ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(samples_to_convert.data(), num_samples_read); ++#endif + + for (size_t j = 0; j < num_samples_read; ++j) { + samples[next_chunk_start + j] = +@@ -155,6 +190,9 @@ + num_bytes_read = file_.Read(&samples[next_chunk_start], + chunk_size * sizeof(samples[0])); + num_samples_read = num_bytes_read / sizeof(samples[0]); ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(&samples[next_chunk_start], num_samples_read); ++#endif + + for (size_t j = 0; j < num_samples_read; ++j) { + samples[next_chunk_start + j] = +@@ -213,24 +251,32 @@ + } + + void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to little-endian when writing to WAV file" +-#endif +- + for (size_t i = 0; i < num_samples; i += kMaxChunksize) { + const size_t num_remaining_samples = num_samples - i; + const size_t num_samples_to_write = + std::min(kMaxChunksize, num_remaining_samples); + + if (format_ == WavFormat::kWavFormatPcm) { ++#ifndef WEBRTC_ARCH_BIG_ENDIAN + RTC_CHECK( + file_.Write(&samples[i], num_samples_to_write * sizeof(samples[0]))); ++#else ++ std::array<int16_t, kMaxChunksize> converted_samples; ++ TranslateEndianness(converted_samples.data(), &samples[i], ++ num_samples_to_write); ++ RTC_CHECK( ++ file_.Write(converted_samples.data(), ++ num_samples_to_write * sizeof(converted_samples[0]))); ++#endif + } else { + RTC_CHECK_EQ(format_, WavFormat::kWavFormatIeeeFloat); + std::array<float, kMaxChunksize> converted_samples; + for (size_t j = 0; j < num_samples_to_write; ++j) { + converted_samples[j] = S16ToFloat(samples[i + j]); + } ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(converted_samples.data(), num_samples_to_write); ++#endif + RTC_CHECK( + file_.Write(converted_samples.data(), + num_samples_to_write * sizeof(converted_samples[0]))); +@@ -243,10 +289,6 @@ + } + + void WavWriter::WriteSamples(const float* samples, size_t num_samples) { +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Need to convert samples to little-endian when writing to WAV file" +-#endif +- + for (size_t i = 0; i < num_samples; i += kMaxChunksize) { + const size_t num_remaining_samples = num_samples - i; + const size_t num_samples_to_write = +@@ -257,6 +299,9 @@ + for (size_t j = 0; j < num_samples_to_write; ++j) { + converted_samples[j] = FloatS16ToS16(samples[i + j]); + } ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(converted_samples.data(), num_samples_to_write); ++#endif + RTC_CHECK( + file_.Write(converted_samples.data(), + num_samples_to_write * sizeof(converted_samples[0]))); +@@ -266,6 +311,9 @@ + for (size_t j = 0; j < num_samples_to_write; ++j) { + converted_samples[j] = FloatS16ToFloat(samples[i + j]); + } ++#ifdef WEBRTC_ARCH_BIG_ENDIAN ++ TranslateEndianness(converted_samples.data(), num_samples_to_write); ++#endif + RTC_CHECK( + file_.Write(converted_samples.data(), + num_samples_to_write * sizeof(converted_samples[0]))); +--- a/webrtc/common_audio/wav_header.cc ++++ b/webrtc/common_audio/wav_header.cc +@@ -14,6 +14,8 @@ + + #include "common_audio/wav_header.h" + ++#include <endian.h> ++ + #include <cstring> + #include <limits> + #include <string> +@@ -26,10 +28,6 @@ + namespace webrtc { + namespace { + +-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN +-#error "Code not working properly for big endian platforms." +-#endif +- + #pragma pack(2) + struct ChunkHeader { + uint32_t ID; +@@ -172,6 +170,8 @@ + if (readable->Read(chunk_header, sizeof(*chunk_header)) != + sizeof(*chunk_header)) + return false; // EOF. ++ chunk_header->Size = le32toh(chunk_header->Size); ++ + if (ReadFourCC(chunk_header->ID) == sought_chunk_id) + return true; // Sought chunk found. + // Ignore current chunk by skipping its payload. +@@ -185,6 +185,13 @@ + if (readable->Read(&(fmt_subchunk->AudioFormat), kFmtPcmSubchunkSize) != + kFmtPcmSubchunkSize) + return false; ++ fmt_subchunk->AudioFormat = le16toh(fmt_subchunk->AudioFormat); ++ fmt_subchunk->NumChannels = le16toh(fmt_subchunk->NumChannels); ++ fmt_subchunk->SampleRate = le32toh(fmt_subchunk->SampleRate); ++ fmt_subchunk->ByteRate = le32toh(fmt_subchunk->ByteRate); ++ fmt_subchunk->BlockAlign = le16toh(fmt_subchunk->BlockAlign); ++ fmt_subchunk->BitsPerSample = le16toh(fmt_subchunk->BitsPerSample); ++ + const uint32_t fmt_size = fmt_subchunk->header.Size; + if (fmt_size != kFmtPcmSubchunkSize) { + // There is an optional two-byte extension field permitted to be present +@@ -212,19 +219,22 @@ + auto header = rtc::MsanUninitialized<WavHeaderPcm>({}); + const size_t bytes_in_payload = bytes_per_sample * num_samples; + +- header.riff.header.ID = PackFourCC('R', 'I', 'F', 'F'); +- header.riff.header.Size = RiffChunkSize(bytes_in_payload, *header_size); +- header.riff.Format = PackFourCC('W', 'A', 'V', 'E'); +- header.fmt.header.ID = PackFourCC('f', 'm', 't', ' '); +- header.fmt.header.Size = kFmtPcmSubchunkSize; +- header.fmt.AudioFormat = MapWavFormatToHeaderField(WavFormat::kWavFormatPcm); +- header.fmt.NumChannels = static_cast<uint16_t>(num_channels); +- header.fmt.SampleRate = sample_rate; +- header.fmt.ByteRate = ByteRate(num_channels, sample_rate, bytes_per_sample); +- header.fmt.BlockAlign = BlockAlign(num_channels, bytes_per_sample); +- header.fmt.BitsPerSample = static_cast<uint16_t>(8 * bytes_per_sample); +- header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); +- header.data.header.Size = static_cast<uint32_t>(bytes_in_payload); ++ header.riff.header.ID = htole32(PackFourCC('R', 'I', 'F', 'F')); ++ header.riff.header.Size = ++ htole32(RiffChunkSize(bytes_in_payload, *header_size)); ++ header.riff.Format = htole32(PackFourCC('W', 'A', 'V', 'E')); ++ header.fmt.header.ID = htole32(PackFourCC('f', 'm', 't', ' ')); ++ header.fmt.header.Size = htole32(kFmtPcmSubchunkSize); ++ header.fmt.AudioFormat = ++ htole16(MapWavFormatToHeaderField(WavFormat::kWavFormatPcm)); ++ header.fmt.NumChannels = htole16(num_channels); ++ header.fmt.SampleRate = htole32(sample_rate); ++ header.fmt.ByteRate = ++ htole32(ByteRate(num_channels, sample_rate, bytes_per_sample)); ++ header.fmt.BlockAlign = htole16(BlockAlign(num_channels, bytes_per_sample)); ++ header.fmt.BitsPerSample = htole16(8 * bytes_per_sample); ++ header.data.header.ID = htole32(PackFourCC('d', 'a', 't', 'a')); ++ header.data.header.Size = htole32(bytes_in_payload); + + // Do an extra copy rather than writing everything to buf directly, since buf + // might not be correctly aligned. +@@ -243,24 +253,26 @@ + auto header = rtc::MsanUninitialized<WavHeaderIeeeFloat>({}); + const size_t bytes_in_payload = bytes_per_sample * num_samples; + +- header.riff.header.ID = PackFourCC('R', 'I', 'F', 'F'); +- header.riff.header.Size = RiffChunkSize(bytes_in_payload, *header_size); +- header.riff.Format = PackFourCC('W', 'A', 'V', 'E'); +- header.fmt.header.ID = PackFourCC('f', 'm', 't', ' '); +- header.fmt.header.Size = kFmtIeeeFloatSubchunkSize; ++ header.riff.header.ID = htole32(PackFourCC('R', 'I', 'F', 'F')); ++ header.riff.header.Size = ++ htole32(RiffChunkSize(bytes_in_payload, *header_size)); ++ header.riff.Format = htole32(PackFourCC('W', 'A', 'V', 'E')); ++ header.fmt.header.ID = htole32(PackFourCC('f', 'm', 't', ' ')); ++ header.fmt.header.Size = htole32(kFmtIeeeFloatSubchunkSize); + header.fmt.AudioFormat = +- MapWavFormatToHeaderField(WavFormat::kWavFormatIeeeFloat); +- header.fmt.NumChannels = static_cast<uint16_t>(num_channels); +- header.fmt.SampleRate = sample_rate; +- header.fmt.ByteRate = ByteRate(num_channels, sample_rate, bytes_per_sample); +- header.fmt.BlockAlign = BlockAlign(num_channels, bytes_per_sample); +- header.fmt.BitsPerSample = static_cast<uint16_t>(8 * bytes_per_sample); +- header.fmt.ExtensionSize = 0; +- header.fact.header.ID = PackFourCC('f', 'a', 'c', 't'); +- header.fact.header.Size = 4; +- header.fact.SampleLength = static_cast<uint32_t>(num_channels * num_samples); +- header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); +- header.data.header.Size = static_cast<uint32_t>(bytes_in_payload); ++ htole16(MapWavFormatToHeaderField(WavFormat::kWavFormatIeeeFloat)); ++ header.fmt.NumChannels = htole16(num_channels); ++ header.fmt.SampleRate = htole32(sample_rate); ++ header.fmt.ByteRate = ++ htole32(ByteRate(num_channels, sample_rate, bytes_per_sample)); ++ header.fmt.BlockAlign = htole16(BlockAlign(num_channels, bytes_per_sample)); ++ header.fmt.BitsPerSample = htole16(8 * bytes_per_sample); ++ header.fmt.ExtensionSize = htole16(0); ++ header.fact.header.ID = htole32(PackFourCC('f', 'a', 'c', 't')); ++ header.fact.header.Size = htole32(4); ++ header.fact.SampleLength = htole32(num_channels * num_samples); ++ header.data.header.ID = htole32(PackFourCC('d', 'a', 't', 'a')); ++ header.data.header.Size = htole32(bytes_in_payload); + + // Do an extra copy rather than writing everything to buf directly, since buf + // might not be correctly aligned. +@@ -389,6 +401,7 @@ + return false; + if (ReadFourCC(header.riff.Format) != "WAVE") + return false; ++ header.riff.header.Size = le32toh(header.riff.header.Size); + + // Find "fmt " and "data" chunks. While the official Wave file specification + // does not put requirements on the chunks order, it is uncommon to find the diff --git a/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r2.ebuild b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r2.ebuild new file mode 100644 index 000000000000..939e470e913f --- /dev/null +++ b/media-libs/webrtc-audio-processing/webrtc-audio-processing-1.3-r2.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson-multilib + +DESCRIPTION="AudioProcessing library from the webrtc.org codebase" +HOMEPAGE="https://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/" +SRC_URI="https://freedesktop.org/software/pulseaudio/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="1" +KEYWORDS="~amd64 ~x86 ~amd64-linux" +IUSE="cpu_flags_arm_neon" + +RDEPEND="dev-cpp/abseil-cpp:=[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-1.3-Add-generic-byte-order-and-pointer-size-detection.patch" + "${FILESDIR}/${PN}-1.3-big-endian-support.patch" +) + +DOCS=( AUTHORS NEWS README.md ) + +multilib_src_configure() { + local emesonargs=( + -Dneon=$(usex cpu_flags_arm_neon yes no) + ) + meson_src_configure +} |