Merge branch 'master' into saveas
[ardour.git] / libs / ardour / delivery.cc
index 3edf2cae69dcb06f8b483581b1499a8a36ba64c7..f16719888f9ff738ecab707fb738fd66b2313ff9 100644 (file)
@@ -148,7 +148,7 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out)
                        }
                } else {
                        fatal << "programming error: this should never be reached" << endmsg;
-                       /*NOTREACHED*/
+                       abort(); /*NOTREACHED*/
                }
 
 
@@ -169,7 +169,7 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out)
                        }
                } else {
                        fatal << "programming error: this should never be reached" << endmsg;
-                       /*NOTREACHED*/
+                       abort(); /*NOTREACHED*/
                }
 
        } else {
@@ -210,7 +210,7 @@ Delivery::configure_io (ChanCount in, ChanCount out)
                        if (_input->n_ports() != in) {
                                if (_input->n_ports() != ChanCount::ZERO) {
                                        fatal << _name << " programming error: configure_io called with " << in << " and " << out << " with " << _input->n_ports() << " input ports" << endmsg;
-                                       /*NOTREACHED*/
+                                       abort(); /*NOTREACHED*/
                                } else {
                                        /* I/O not yet configured */
                                }
@@ -262,8 +262,7 @@ Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pf
        if (tgain != _current_gain) {
                /* target gain has changed */
 
-               Amp::apply_gain (bufs, nframes, _current_gain, tgain);
-               _current_gain = tgain;
+               _current_gain = Amp::apply_gain (bufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain);
 
        } else if (tgain == 0.0) {
 
@@ -557,7 +556,7 @@ Delivery::set_name (const std::string& name)
 {
        bool ret = IOProcessor::set_name (name);
 
-       if (ret) {
+       if (ret && _panshell) {
                ret = _panshell->set_name (name);
        }