Fix off-by-one in computation of crossfade lengths.
authorCarl Hetherington <carl@carlh.net>
Sun, 10 Jun 2012 13:07:28 +0000 (13:07 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 10 Jun 2012 13:07:28 +0000 (13:07 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12642 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audio_playlist.cc

index 6653e2f655a58befc923e6cb1f9254618bd8c5b3..c1b6bb6e6d36652eac54e6302e90299c84f95937 100644 (file)
@@ -335,7 +335,7 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
                                                } else {
                                                        switch (_session.config.get_xfade_model()) {
                                                        case FullCrossfade:
-                                                               len = bottom->last_frame () - top->first_frame ();
+                                                               len = bottom->last_frame () - top->first_frame () + 1;
                                                                top->set_fade_in_is_short (false);
                                                                break;
                                                        case ShortCrossfade:
@@ -395,7 +395,7 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
                                                } else {
                                                        switch (_session.config.get_xfade_model()) {
                                                        case FullCrossfade:
-                                                               len = top->last_frame () - bottom->first_frame ();
+                                                               len = top->last_frame () - bottom->first_frame () + 1;
                                                                break;
                                                        case ShortCrossfade:
                                                                len = _session.config.get_short_xfade_seconds() * _session.frame_rate();