From 5dba72c874def27bef3ba3fe7a5cf2414e77aadb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 31 Oct 2011 21:17:08 +0000 Subject: Take commit() out of process() in both types of diskstream, and call commit() where appropriate. git-svn-id: svn://localhost/ardour2/branches/3.0@10361 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_diskstream.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'libs/ardour/audio_diskstream.cc') diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index e5ae9a1506..51a3b72bf6 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -415,18 +415,17 @@ AudioDiskstream::prepare_record_status(framepos_t capture_start_frame) * that someone can read playback_distance worth of data from. */ int -AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& need_butler) +AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecnt_t& playback_distance) { uint32_t n; boost::shared_ptr c = channels.reader(); ChannelList::iterator chan; - int ret = -1; framecnt_t rec_offset = 0; framecnt_t rec_nframes = 0; bool collect_playback = false; bool can_record = _session.actively_recording (); - framecnt_t playback_distance = 0; + playback_distance = 0; if (!_io || !_io->active()) { return 0; @@ -511,7 +510,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n if (rec_nframes > total) { DiskOverrun (); - goto out; + return -1; } boost::shared_ptr const ap = _io->audio (n); @@ -617,7 +616,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n cerr << _name << " Need " << necessary_samples << " total = " << total << endl; cerr << "underrun for " << _name << endl; DiskUnderrun (); - goto out; + return -1; } else { @@ -663,14 +662,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool& n _speed = _target_speed; } - ret = 0; - - if (commit (playback_distance)) { - need_butler = true; - } - - out: - return ret; + return 0; } /** Update various things including playback_sample, read pointer on each channel's playback_buf -- cgit v1.2.3