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()
This commit is contained in:
Robin Gareus 2025-05-19 22:19:54 +02:00
parent d537cdf60b
commit ba7e63f570
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -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;
}