diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-20 23:26:50 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-20 23:26:50 -0400 |
commit | 78296d2c18c324f0fbfa6add4eca6ad5f9995775 (patch) | |
tree | 395c1440e5ec7d4457ee86c08cb2bf72d6a69a27 /libs/ardour/audio_port.cc | |
parent | 9c323c59ef8637ee418785fb26d76770909d5b63 (diff) |
tentative fix for a crash that occurs when switching backends.5.0-pre1
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.
Diffstat (limited to 'libs/ardour/audio_port.cc')
-rw-r--r-- | libs/ardour/audio_port.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc index e2bb20dbe9..33e41c10ad 100644 --- a/libs/ardour/audio_port.cc +++ b/libs/ardour/audio_port.cc @@ -59,8 +59,11 @@ void AudioPort::cycle_end (pframes_t nframes) { if (sends_output() && !_buffer->written()) { - if (_buffer->capacity() >= nframes) { - _buffer->silence (nframes); + if (!_buffer->data (0)) { + get_audio_buffer (nframes); + } + if (_buffer->capacity() >= nframes) { + _buffer->silence (nframes); } } } |