catch jack shutdown (from server) and handle it better then we used to in terms of preventing things from believing that we are still connected

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5006 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-04-29 02:14:35 +00:00
parent 8ed0d9e95a
commit 5910198300
3 changed files with 13 additions and 6 deletions

View File

@ -1090,7 +1090,7 @@ class Session : public PBD::StatefulDestructible
void reset_slave_state ();
bool follow_slave (nframes_t);
void set_slave_source (SlaveSource);
void set_slave_source (SlaveSource, bool stop_transport = true);
bool _exporting;
int prepare_to_export (ARDOUR::AudioExportSpecification&);

View File

@ -819,6 +819,7 @@ AudioEngine::halted (void *arg)
ae->_running = false;
ae->_buffer_size = 0;
ae->_frame_rate = 0;
ae->_jack = 0;
if (was_running) {
ae->Halted(); /* EMIT SIGNAL */
@ -962,8 +963,7 @@ nframes_t
AudioEngine::get_port_total_latency (const Port& port)
{
if (!_jack) {
fatal << _("get_port_total_latency() called with no JACK client connection") << endmsg;
/*NOTREACHED*/
return 0;
}
return jack_port_get_total_latency (_jack, port._port);

View File

@ -1016,7 +1016,7 @@ Session::reset_rf_scale (nframes_t motion)
}
void
Session::set_slave_source (SlaveSource src)
Session::set_slave_source (SlaveSource src, bool stop_the_transport)
{
bool reverse = false;
bool non_rt_required = false;
@ -1041,7 +1041,9 @@ Session::set_slave_source (SlaveSource src)
switch (src) {
case None:
stop_transport ();
if (stop_the_transport) {
stop_transport ();
}
break;
case MTC:
@ -1233,11 +1235,16 @@ Session::engine_halted ()
g_atomic_int_set (&butler_should_do_transport_work, 0);
post_transport_work = PostTransportWork (0);
stop_butler ();
realtime_stop (false);
non_realtime_stop (false, 0, ignored);
transport_sub_state = 0;
if (synced_to_jack()) {
/* transport is already stopped, hence the second argument */
set_slave_source (None, false);
}
TransportStateChange (); /* EMIT SIGNAL */
}