From 8c4eefbc37e3c696b6f996bd27cb95783af798bdaa06052ebb40eb9e4fd538a7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 1 Mar 2022 07:45:08 +0000 Subject: [PATCH] Accepting request 958201 from home:tiwai:branches:multimedia:libs - Fix the regression for audiofile, reverting the problematic change 0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch OBS-URL: https://build.opensuse.org/request/show/958201 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/flac?expand=0&rev=61 --- ...tream_decoder.c-Use-current-position.patch | 48 +++++++++++++++++++ flac.changes | 6 +++ flac.spec | 1 + 3 files changed, 55 insertions(+) create mode 100644 0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch diff --git a/0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch b/0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch new file mode 100644 index 0000000..8bd097a --- /dev/null +++ b/0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch @@ -0,0 +1,48 @@ +From 2834dd4eb51a1847a424a3d7ea799b38a62487e9 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 1 Mar 2022 08:16:45 +0100 +Subject: [PATCH] Revert "libFLAC/stream_decoder.c: Use current position as + bound when seeking" + +This reverts commit 159cd6c41a6ec17b36d74043c45a3aa64de90d5e. +--- + src/libFLAC/stream_decoder.c | 17 +++-------------- + 1 file changed, 3 insertions(+), 14 deletions(-) + +diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c +index 4380b486fd5f..0e7264809dbf 100644 +--- a/src/libFLAC/stream_decoder.c ++++ b/src/libFLAC/stream_decoder.c +@@ -3067,26 +3067,15 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s + + /* + * First, we set an upper and lower bound on where in the +- * stream we will search. For now we take the current position +- * as one bound and, depending on where the target position lies, +- * the beginning of the first frame or the end of the stream as +- * the other bound. ++ * stream we will search. For now we assume the worst case ++ * scenario, which is our best guess at the beginning of ++ * the first frame and end of the stream. + */ + lower_bound = first_frame_offset; + lower_bound_sample = 0; + upper_bound = stream_length; + upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/; + +- if(decoder->protected_->state == FLAC__STREAM_DECODER_READ_FRAME) { +- if(target_sample < decoder->private_->samples_decoded) { +- if(FLAC__stream_decoder_get_decode_position(decoder, &upper_bound)) +- upper_bound_sample = decoder->private_->samples_decoded; +- } else { +- if(FLAC__stream_decoder_get_decode_position(decoder, &lower_bound)) +- lower_bound_sample = decoder->private_->samples_decoded; +- } +- } +- + /* + * Now we refine the bounds if we have a seektable with + * suitable points. Note that according to the spec they +-- +2.31.1 + diff --git a/flac.changes b/flac.changes index 2c7f4a9..cca9521 100644 --- a/flac.changes +++ b/flac.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 1 08:18:11 CET 2022 - tiwai@suse.de + +- Fix the regression for audiofile, reverting the problematic change + 0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch + ------------------------------------------------------------------- Tue Feb 22 07:20:01 UTC 2022 - Paolo Stivanin diff --git a/flac.spec b/flac.spec index 6f38f03..31be6aa 100644 --- a/flac.spec +++ b/flac.spec @@ -29,6 +29,7 @@ URL: https://xiph.org/flac/ Source: https://downloads.xiph.org/releases/flac/%{name}-%{version}.tar.xz Source2: baselibs.conf Patch0: flac-cflags.patch +Patch1: 0001-Revert-libFLAC-stream_decoder.c-Use-current-position.patch BuildRequires: autoconf >= 2.60 BuildRequires: automake >= 1.11 BuildRequires: gcc-c++