Hi,I created a MR on slasa to fix this bug: https://salsa.debian.org/multimedia-team/flac/-/merge_requests/2 (also attached as patch).
I tested to build audiofile with the fixed flac version and it built fine. Best regards Philip
From b138df45a8dda1fc569e4f3ebccda8e6da724111 Mon Sep 17 00:00:00 2001 From: Philip Rinn <rinni@inventati.org> Date: Tue, 7 Jun 2022 17:10:01 +0200 Subject: [PATCH] Add upstream patch to fix seeking bug (closes: #1008424) --- debian/changelog | 6 ++++++ debian/patches/Fix-seeking-bug.patch | 29 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 36 insertions(+) create mode 100644 debian/patches/Fix-seeking-bug.patch diff --git a/debian/changelog b/debian/changelog index 6fbc75481..57af6ca31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +flac (1.3.4-2) UNRELEASED; urgency=medium + + * Add upstream patch to fix seeking bug (closes: #1008424) + + -- Philip Rinn <rinni@inventati.org> Tue, 07 Jun 2022 17:03:22 +0200 + flac (1.3.4-1) unstable; urgency=medium * New upstream version 1.3.4 diff --git a/debian/patches/Fix-seeking-bug.patch b/debian/patches/Fix-seeking-bug.patch new file mode 100644 index 000000000..cf4b8a2f6 --- /dev/null +++ b/debian/patches/Fix-seeking-bug.patch @@ -0,0 +1,29 @@ +From 7e785eb9a84f9147246eb2b0e5e35ec01db5a815 Mon Sep 17 00:00:00 2001 +From: Martijn van Beurden <mvanb1@gmail.com> +Date: Mon, 25 Apr 2022 20:29:57 +0200 +Subject: [PATCH] Fix seeking bug + +Commit 159cd6c introduced a bug that only triggered upon seeking +from the start of a headerless FLAC file to the first frame (so +really not a seek at all). Furthermore that commit did nothing +else in any other circumstance. This commit fixes that, by both +fixing the problem and the behaviour the commit mentioned earlier +meant to introduce. + +Co-authored-by: Robert Kausch <robert.kausch@freac.org> +--- + src/libFLAC/stream_decoder.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/libFLAC/stream_decoder.c ++++ b/src/libFLAC/stream_decoder.c +@@ -3091,7 +3091,8 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s + 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(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC && ++ decoder->private_->samples_decoded != 0) { + if(target_sample < decoder->private_->samples_decoded) { + if(FLAC__stream_decoder_get_decode_position(decoder, &upper_bound)) + upper_bound_sample = decoder->private_->samples_decoded; diff --git a/debian/patches/series b/debian/patches/series index df1dcab6f..f3c871162 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ Revert-man-Makefile-Fail-more-gracefully.patch privacy-breach-logo.patch 0001-remove-build-path-from-generated-FLAC.tag-file.patch +Fix-seeking-bug.patch -- GitLab
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature