- spanner_duration_ = music_get_length ();
-
- Moment *mp
- = unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
- if (mp)
- spanner_duration_ = min (mp->main_part_, spanner_duration_);
+ if (Duration *d = unsmob<Duration> (get_music ()->get_property ("duration")))
+ spanner_duration_ = d->get_length ();
+ else if (Moment *mp
+ = unsmob<Moment> (get_outlet ()->get_property ("tupletSpannerDuration")))
+ spanner_duration_ = mp->main_part_;
+ else
+ spanner_duration_.set_infinite (1);