Some more assert() debugging

This commit is contained in:
Robin Gareus 2017-08-03 23:37:38 +02:00
parent 1937c74191
commit 6b5d374352
4 changed files with 10 additions and 3 deletions

View file

@ -77,6 +77,7 @@ AudioBuffer&
AudioPort::get_audio_buffer (pframes_t nframes) AudioPort::get_audio_buffer (pframes_t nframes)
{ {
/* caller must hold process lock */ /* caller must hold process lock */
assert (_port_handle);
_buffer->set_data ((Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes) + _buffer->set_data ((Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes) +
_global_port_buffer_offset + _port_buffer_offset, nframes); _global_port_buffer_offset + _port_buffer_offset, nframes);
return *_buffer; return *_buffer;
@ -86,6 +87,7 @@ Sample*
AudioPort::engine_get_whole_audio_buffer () AudioPort::engine_get_whole_audio_buffer ()
{ {
/* caller must hold process lock */ /* caller must hold process lock */
assert (_port_handle);
return (Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes); return (Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes);
} }

View file

@ -64,6 +64,7 @@ using namespace Timecode;
void void
Session::ltc_tx_initialize() Session::ltc_tx_initialize()
{ {
assert (!ltc_encoder && !ltc_enc_buf);
ltc_enc_tcformat = config.get_timecode_format(); ltc_enc_tcformat = config.get_timecode_format();
ltc_tx_parse_offset(); ltc_tx_parse_offset();
@ -93,11 +94,11 @@ void
Session::ltc_tx_cleanup() Session::ltc_tx_cleanup()
{ {
DEBUG_TRACE (DEBUG::LTC, "LTC TX cleanup\n"); DEBUG_TRACE (DEBUG::LTC, "LTC TX cleanup\n");
ltc_tx_connections.drop_connections ();
free(ltc_enc_buf); free(ltc_enc_buf);
ltc_enc_buf = NULL; ltc_enc_buf = NULL;
ltc_encoder_free(ltc_encoder); ltc_encoder_free(ltc_encoder);
ltc_encoder = NULL; ltc_encoder = NULL;
ltc_tx_connections.drop_connections ();
} }
void void

View file

@ -1569,7 +1569,9 @@ CoreAudioBackend::n_physical_inputs () const
void* void*
CoreAudioBackend::get_buffer (PortEngine::PortHandle port, pframes_t nframes) CoreAudioBackend::get_buffer (PortEngine::PortHandle port, pframes_t nframes)
{ {
if (!port || !valid_port (port)) return NULL; assert (port);
assert (valid_port (port));
if (!port || !valid_port (port)) return NULL; // XXX remove me
return static_cast<CoreBackendPort*>(port)->get_buffer (nframes); return static_cast<CoreBackendPort*>(port)->get_buffer (nframes);
} }

View file

@ -1816,7 +1816,9 @@ PortAudioBackend::n_physical_inputs () const
void* void*
PortAudioBackend::get_buffer (PortEngine::PortHandle port, pframes_t nframes) PortAudioBackend::get_buffer (PortEngine::PortHandle port, pframes_t nframes)
{ {
if (!port || !valid_port (port)) return NULL; assert (port);
assert (valid_port (port));
if (!port || !valid_port (port)) return NULL; // XXX remove me
return static_cast<PamPort*>(port)->get_buffer (nframes); return static_cast<PamPort*>(port)->get_buffer (nframes);
} }