summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-03-19 19:48:21 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-03-19 19:48:21 +0000
commitfc26b49ac5e177857a155a567ff9f966f330e261 (patch)
treecf2dce4859b641ce6009ebcdc67ad71c8556a0ab /libs/ardour/audio_diskstream.cc
parent36d88c8e494c1997c05d122fa03c00d0e8b6e401 (diff)
kill glib-induced abort caused by asymmetric lock/unlock of diskstream state lock
git-svn-id: svn://localhost/ardour2/trunk@1627 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 887838796b..48085d4922 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -524,6 +524,8 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
return 0;
}
+ commit_should_unlock = false;
+
check_record_status (transport_frame, nframes, can_record);
nominally_recording = (can_record && re);
@@ -542,7 +544,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
if (!state_lock.trylock()) {
return 1;
}
-
+ commit_should_unlock = true;
adjust_capture_position = 0;
for (chan = c->begin(); chan != c->end(); ++chan) {
@@ -788,6 +790,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
be called. unlock the state lock.
*/
+ commit_should_unlock = false;
state_lock.unlock();
}
@@ -827,7 +830,10 @@ AudioDiskstream::commit (nframes_t nframes)
|| c->front()->capture_buf->read_space() >= disk_io_chunk_frames;
}
- state_lock.unlock();
+ if (commit_should_unlock) {
+ state_lock.unlock();
+ }
+
_processed = false;
return need_butler;