Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
b5aaff6181
!62 [sync] PR-58: 源码包同源异构问题修复
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2025-02-17 12:32:07 +00:00
沈仲伟
93168c84d7 include all patches in the source package.
(cherry picked from commit cacf6e06d2f61ffe7e1352fc9c61ab98d31fb8d1)
2025-02-17 20:31:29 +08:00
openeuler-ci-bot
09ae54a152
!59 手动同步PR!50
From: @zhong-wei-shen 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2025-02-17 12:29:01 +00:00
沈仲伟
1ed3149c27 sync from master 2024-12-10 09:48:20 +08:00
openeuler-ci-bot
6454f691b5
!51 [sync] PR-49: fix flac license
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2024-08-10 03:12:59 +00:00
EulerOSWander
de9d63f2ed fix flac license
(cherry picked from commit 578ee5433b349be47eadb228043fd9b3ef24b640)
2024-08-09 17:15:27 +08:00
openeuler-ci-bot
e1a018a4e5
!48 Update to flac-1.4.3
From: @chenhaixaing 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2024-02-07 01:09:58 +00:00
chenhaixiang
07d406d8dc Update to flac-1.4.3
Signed-off-by chenhaixiang <chenhaixiang3@huawei.com>
2024-02-06 21:24:53 +08:00
openeuler-ci-bot
9ea388a14a
!40 Update to flac-1.4.2
From: @chenhaixaing 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2023-01-31 08:58:57 +00:00
chenhaixiang
74b4098adb Update to flac-1.4.2
Signed-off-by chenhaixiang <chenhaixiang3@huawei.com>
2023-01-31 10:59:10 +08:00
9 changed files with 254 additions and 51 deletions

View File

@ -0,0 +1,35 @@
From 7317471efb25f65f2d63b3de20d55c2519770d52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lee=20Carr=C3=A9?=
<83581502+Lee-Carre@users.noreply.github.com>
Date: Sat, 2 Sep 2023 18:17:44 +0000
Subject: [PATCH] Documentation (man/flac.md); fix typo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Section: `Apodization functions`
From:
> For partial_tukey(n) and punchout_tukey(n), […] The use of this is that different parts of a block are ignored as the might contain transients which are hard to predict anyway. […]
to (emphasis added only in this summary, not in the source):
> For partial_tukey(n) and punchout_tukey(n), […] The use of this is that different parts of a block are ignored as the**y** might contain transients which are hard to predict anyway. […]
---
man/flac.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/flac.md b/man/flac.md
index b51ac698a4..87969bf6d9 100644
--- a/man/flac.md
+++ b/man/flac.md
@@ -715,7 +715,7 @@ yield sane results. If necessary, an overlap can be specified, as can be
the taper parameter, for example partial_tukey(2/0.2) or
partial_tukey(2/0.2/0.5). ov should be smaller than 1 and can be
negative. The use of this is that different parts of a block are ignored
-as the might contain transients which are hard to predict anyway. The
+as they might contain transients which are hard to predict anyway. The
encoder will try each different added apodization (each covering a
different part of the block) to see which resulting predictor results in
the smallest representation.

View File

@ -0,0 +1,35 @@
From df57d1d6b009e8044938390b21599d2910f867ea Mon Sep 17 00:00:00 2001
From: Martijn van Beurden <mvanb1@gmail.com>
Date: Tue, 5 Mar 2024 14:28:26 +0100
Subject: [PATCH] Fix format ending up with wrong subformat
It was possible the format was taken from foreign metadata and the
subformat from command-line options.
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63790
---
src/flac/main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/flac/main.c b/src/flac/main.c
index d57ad9ccaa..46a2dcc742 100644
--- a/src/flac/main.c
+++ b/src/flac/main.c
@@ -2192,10 +2192,14 @@ int decode_file(const char *infilename)
output_format = FORMAT_WAVE;
/* Now do subformats */
- if(option_values.force_legacy_wave_format)
+ if(option_values.force_legacy_wave_format) {
+ output_format = FORMAT_WAVE;
output_subformat = SUBFORMAT_WAVE_PCM;
- else if(option_values.force_extensible_wave_format)
+ }
+ else if(option_values.force_extensible_wave_format) {
+ output_format = FORMAT_WAVE;
output_subformat = SUBFORMAT_WAVE_EXTENSIBLE;
+ }
else if(option_values.force_aiff_c_none_format) {
output_format = FORMAT_AIFF_C;
output_subformat = SUBFORMAT_AIFF_C_NONE;

View File

@ -0,0 +1,103 @@
From 32b73cbced65208758d0d610327c600828db45ae Mon Sep 17 00:00:00 2001
From: Martijn van Beurden <mvanb1@gmail.com>
Date: Tue, 27 Jun 2023 10:39:09 +0200
Subject: [PATCH] Limit the number of clock() calls
The overhead of calling clock() when encoding/decoding very small
frames turned out to be very large, for framesize 16 these syscalls
took over half the execution time. This commit only calls clock()
when at least 10.000 samples have been encoded or 25.000 samples
have been decoded since the last call to clock()
---
src/flac/decode.c | 19 ++++++++++++++-----
src/flac/encode.c | 19 ++++++++++++++-----
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/flac/decode.c b/src/flac/decode.c
index 90f7a6c860..e832d70731 100644
--- a/src/flac/decode.c
+++ b/src/flac/decode.c
@@ -94,7 +94,8 @@ typedef struct {
foreign_metadata_t *foreign_metadata; /* NULL unless --keep-foreign-metadata requested */
FLAC__off_t fm_offset1, fm_offset2, fm_offset3;
- clock_t old_clock_t;
+ clock_t old_clock;
+ FLAC__uint64 old_samples_processed;
} DecoderSession;
@@ -253,7 +254,8 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
d->foreign_metadata = foreign_metadata;
- d->old_clock_t = 0;
+ d->old_clock = 0;
+ d->old_samples_processed = 0;
FLAC__ASSERT(!(d->test_only && d->analysis_mode));
@@ -1239,9 +1241,16 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
if(!(decoder_session->frame_counter & 0x1ff))
print_stats(decoder_session);
#else
- if((clock() - decoder_session->old_clock_t) > (CLOCKS_PER_SEC/4)) {
- print_stats(decoder_session);
- decoder_session->old_clock_t = clock();
+ if(decoder_session->samples_processed - decoder_session->old_samples_processed > 25000) {
+ /* We're assuming that even on old hardware libFLAC can easily process
+ * 100.000 samples per second, even on old hardware. To limit the number
+ * of (expensive) syscalls, we only check clock every 25.000 samples */
+ clock_t cur_clock = clock();
+ decoder_session->old_samples_processed = decoder_session->samples_processed;
+ if((cur_clock - decoder_session->old_clock) > (CLOCKS_PER_SEC/4)) {
+ print_stats(decoder_session);
+ decoder_session->old_clock = cur_clock;
+ }
}
#endif
diff --git a/src/flac/encode.c b/src/flac/encode.c
index a945b356a5..0eb9a172f2 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -94,7 +94,8 @@ typedef struct {
uint32_t stats_frames_interval;
uint32_t old_frames_written;
#else
- clock_t old_clock_t;
+ uint32_t old_samples_written;
+ clock_t old_clock;
#endif
SampleInfo info;
@@ -1407,7 +1408,8 @@ FLAC__bool EncoderSession_construct(EncoderSession *e, encode_options_t options,
e->stats_frames_interval = 0;
e->old_frames_written = 0;
#else
- e->old_clock_t = 0;
+ e->old_clock = 0;
+ e->old_samples_written = 0;
#endif
e->compression_ratio = 0.0;
@@ -2422,9 +2424,16 @@ void encoder_progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64
e->old_frames_written = frames_written;
}
#else
- if(e->total_samples_to_encode > 0 && (clock() - e->old_clock_t) > (CLOCKS_PER_SEC/4)) {
- print_stats(e);
- e->old_clock_t = clock();
+ if(e->total_samples_to_encode > 0 && samples_written - e->old_samples_written > 10000) {
+ /* We're assuming that except for extremely slow settings, libFLAC can easily
+ * process 40.000 samples per second, even on old hardware. To limit the number
+ * of (expensive) syscalls, we only check clock every 10.000 samples */
+ clock_t cur_clock = clock();
+ e->old_samples_written = samples_written;
+ if((cur_clock - e->old_clock) > (CLOCKS_PER_SEC/4)) {
+ print_stats(e);
+ e->old_clock = cur_clock;
+ }
}
#endif

Binary file not shown.

View File

@ -1,6 +1,6 @@
diff -Nuar flac-1.3.4.org/m4/endian.m4 flac-1.3.4.sw/m4/endian.m4
--- flac-1.3.4.org/m4/endian.m4 2022-03-03 02:53:08.140000000 +0000
+++ flac-1.3.4.sw/m4/endian.m4 2022-03-03 02:54:44.740000000 +0000
diff -Nuar flac-1.4.3.org/m4/endian.m4 flac-1.4.3.sw/m4/endian.m4
--- flac-1.4.3.org/m4/endian.m4 2022-03-03 02:53:08.140000000 +0000
+++ flac-1.4.3.sw/m4/endian.m4 2022-03-03 02:54:44.740000000 +0000
@@ -115,7 +115,7 @@
# by looking at the target CPU type.
[

BIN
flac-1.4.3.tar.xz Normal file

Binary file not shown.

View File

@ -0,0 +1,40 @@
From 14ef37063f98786fcf4d5e81181c278a8000ea55 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sun, 5 Nov 2023 21:50:05 +0000
Subject: [PATCH] flac: foreign_metadata: fix -Walloc-size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
src/flac/foreign_metadata.c:803:33: warning: allocation of insufficient size 1 for type foreign_metadata_t with size 64 [-Walloc-size]
```
The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```
So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(foreign_metadata_t)`. GCC then sees we're not
doing anything wrong.
Signed-off-by: Sam James <sam@gentoo.org>
---
src/flac/foreign_metadata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c
index f63fc3e60a..ab6644c301 100644
--- a/src/flac/foreign_metadata.c
+++ b/src/flac/foreign_metadata.c
@@ -800,7 +800,7 @@ static FLAC__bool compare_with_iff_(foreign_metadata_t *fm, FILE *fin, FILE *fou
foreign_metadata_t *flac__foreign_metadata_new(foreign_block_type_t type)
{
/* calloc() to zero all the member variables */
- foreign_metadata_t *x = calloc(sizeof(foreign_metadata_t), 1);
+ foreign_metadata_t *x = calloc(1, sizeof(foreign_metadata_t));
if(x) {
x->type = type;
x->is_rf64 = false;

View File

@ -1,23 +1,22 @@
%define xmms_inputdir %(xmms-config --input-plugin-dir 2>/dev/null || echo %{_libdir}/xmms/General)
Name: flac
Version: 1.3.4
Release: 1
Version: 1.4.3
Release: 4
Summary: encoder/decoder which support the Free Lossless Audio Codec
License: BSD and GPLv2+ and GFDL
License: BSD-3-Clause AND GPL-2.0-or-later AND GFDL-1.1-or-later
Source0: http://downloads.xiph.org/releases/flac/flac-%{version}.tar.xz
URL: http://www.xiph.org/flac/
%ifarch sw_64
Patch0000: flac-1.3.4-sw.patch
%endif
Patch0001: flac-1.4.3-sw.patch
Patch6001: Limit-the-number-of-clock-calls.patch
Patch6002: Documentation-man-flac.md-fix-typo.patch
Patch6003: flac-foreign_metadata-fix-Walloc-size.patch
Patch6004: Fix-format-ending-up-with-wrong-subformat.patch
Provides: %{name}-libs
Obsoletes: %{name}-libs
BuildRequires: gcc-c++ libogg-devel gcc automake autoconf libtool gettext-devel doxygen
BuildRequires: xmms-devel desktop-file-utils
Source1: xmms-flac.desktop
BuildRequires: desktop-file-utils
%description
FLAC stands for Free Lossless Audio Codec, an audio format similar to MP3,
@ -31,17 +30,6 @@ Requires: flac
%description devel
FLAC libraries and header files for development.
%package -n xmms-flac
Summary: XMMS plugin needed to play FLAC files
License: GPLv2+
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
%description -n xmms-flac
This package contains an XMMS input plugin to play FLAC audio streams. It also
provides symlinks for it to work with Beep Media Player, since plugins between
the two players are interchangeable.
%package help
Summary: help package for %{name} with man docs
@ -49,39 +37,37 @@ Summary: help package for %{name} with man docs
document files for %{name}
%prep
%autosetup -n %{name}-%{version} -p1
%setup -n %{name}-%{version}
%ifarch sw_64
%patch -P 1 -p1
%endif
%autopatch -m6001 -p1
%build
./autogen.sh -V
export CFLAGS="%{optflags} -funroll-loops"
%configure --enable-xmms-plugin --disable-silent-rules --disable-thorough-tests
%configure --disable-silent-rules --disable-thorough-tests
make
%install
%make_install
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
mv %{buildroot}%{_docdir}/flac* ./flac-doc
mkdir -p flac-doc-devel
mv flac-doc{/api,-devel}
rm flac-doc/FLAC.tag %{buildroot}%{_libdir}/*.la \
%{buildroot}%{xmms_inputdir}/*.la
rm flac-doc/FLAC.tag %{buildroot}%{_libdir}/*.la
%check
#make -C test check FLAC__TEST_LEVEL=0 &> /dev/null
%ldconfig_scriptlets libs
%post -n xmms-flac
update-desktop-database &> /dev/null || :
%postun -n xmms-flac
update-desktop-database &> /dev/null || :
%files
%doc flac-doc/* AUTHORS COPYING* README
%doc flac-doc/* AUTHORS COPYING* README.md
%{_bindir}/flac
%{_bindir}/metaflac
%{_libdir}/*.so.*
@ -92,16 +78,29 @@ update-desktop-database &> /dev/null || :
%{_libdir}/pkgconfig/*
%{_datadir}/aclocal/*.m4
%files -n xmms-flac
%license COPYING.GPL
%{_datadir}/applications/xmms-flac.desktop
%{xmms_inputdir}/libxmms-flac.so
%files help
%{_mandir}/man1/*
%doc flac-doc-devel/*
%changelog
* Tue Dec 10 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 1.4.3-4
- include all patches in the source package.
* Fri Aug 9 2024 zhangxingrong <zhangxingrong@uniontech.cn> - 1.4.3-3
- Limit the number of clock() calls
- Documentation (man/flac.md); fix typo
- flac: foreign_metadata: fix -Walloc-size
- Fix format ending up with wrong subformat
* Fri Aug 9 2024 chenhaixiang<chenhaixiang3@huawei.com> - 1.4.3-2
- fix flac license
* Tue Feb 6 2024 chenhaixiang<chenhaixiang3@huawei.com> - 1.4.3-1
- update to 1.4.3
* Mon Jan 30 2023 chenhaixiang<chenhaixiang3@huawei.com> - 1.4.2-1
- update to 1.4.2
* Wed Nov 9 2022 chenhaixiang<chenhaixiang3@huawei.com> - 1.3.4-1
- update to 1.3.4

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Name=XMMS
Exec=xmms -p -e %F
Icon=xmms
MimeType=audio/x-flac;audio/flac;
Categories=AudioVideo;Player;
Terminal=false
Type=Application
NoDisplay=true