From ba7e63f570c199b4879ca05ca61e409c63a32cab Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 19 May 2025 22:19:54 +0200 Subject: [PATCH] Ignore FLAC seek/peak-file read while recording FLAC files are either read-only or write-only. When recording the GUI may ask for additional data to render. Depending on zoom level, this may require seeking in the audio data, which in case of FLAC is not possible, and should fail silently: ARDOUR::SndFileSource::read_unlocked() ARDOUR::AudioRegion::read_peaks() ArdourWaveView::WaveView::process_draw_request() --- libs/ardour/sndfilesource.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 4f03edc8e4..fbecf0c70e 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -553,7 +553,9 @@ SndFileSource::read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) c if (sf_seek (_sndfile, (sf_count_t) start, SEEK_SET|SFM_READ) != (sf_count_t) start) { char errbuf[256]; sf_error_str (0, errbuf, sizeof (errbuf) - 1); - error << string_compose(_("SndFileSource: could not seek to sample %1 within %2 (%3)"), start, _name, errbuf) << endmsg; + if ((_info.format & SF_FORMAT_TYPEMASK ) != SF_FORMAT_FLAC && writable ()) { + error << string_compose(_("SndFileSource: could not seek to sample %1 within %2 (%3)"), start, _name, errbuf) << endmsg; + } return 0; }