[ardour-dev] [PATCH] correct update of _transport_position

Karsten Wiese annabellesgarden at yahoo.de
Sat Oct 22 11:12:16 PDT 2005


this not that critical, as the only buggy update appears under
this comment:
	/* something isn't right, but we should move with the master
	   for now.
here the patch changes
	jack_nframes_t frames_moved
where jack_nframes_t is unsigned, into
	long frames_moved
so that the following
	if (frames_moved < 0)
behaves like in the other 2 occurrences of this construct.
Without patch, decrement_transport_position ()
wont ever be called here.

The patch creates the new function
	void Session::update_transport_position (uint32_t val)
and replaces the 3 occurrences of
	if (frames_moved < 0) {
		decrement_transport_position (-frames_moved);
	} else {
		increment_transport_position (frames_moved);
with calls to it.

This might be unsafe in
	Session::process_without_events (jack_nframes_t nframes),
where the original code is:
	frames_moved = (long) floor (_transport_speed * nframes);

	if (process_routes (nframes, 0)) {
		no_roll (nframes, 0);

	commit_diskstreams (nframes, session_needs_butler);

	if (frames_moved < 0) {
		decrement_transport_position (-frames_moved);
	} else {
		increment_transport_position (frames_moved);
Patch is only correct here, if _transport_speed isn't updated under
process_routes() or commit_diskstreams ().

-------------- next part --------------
A non-text attachment was scrubbed...
Name: update_transport_position.patch
Type: text/x-diff
Size: 2610 bytes
Desc: not available
URL: <http://lists.ardour.org/pipermail/ardour-dev-ardour.org/attachments/20051022/8b9c3379/attachment.patch>

More information about the Ardour-Dev mailing list