From 78296d2c18c324f0fbfa6add4eca6ad5f9995775 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 20 Jul 2016 23:26:50 -0400 Subject: tentative fix for a crash that occurs when switching backends. Session::process() returns early with Session::_silent set to true. AudioBuffer::set_data() was never set for (at least) the LTC output port. PortManager::cycle_end() calls AudioBuffer::silence() which used to assume that get_buffer() must have been called. But it was not, because that should have happened in Session::process(). So check AudioBuffer::data() and call get_buffer() if required. --- libs/ardour/ardour/audio_buffer.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libs/ardour/ardour/audio_buffer.h') diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 051b75ab4b..9a9653b2c9 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -220,7 +220,13 @@ public: */ bool check_silence (pframes_t nframes, pframes_t& n) const; - void prepare () { _written = false; _silent = false; } + void prepare () { + if (!_owns_data) { + _data = 0; + } + _written = false; + _silent = false; + } bool written() const { return _written; } void set_written(bool w) { _written = w; } -- cgit v1.2.3