+ boost::shared_ptr<Track> t1 (boost::dynamic_pointer_cast<Track>(r1));
+ boost::shared_ptr<Track> t2 (boost::dynamic_pointer_cast<Track>(r2));
+ PresentationInfo::order_t r1o = r1->presentation_info().order();
+ PresentationInfo::order_t r2o = r2->presentation_info().order();
+
+ if (!t1) {
+ if (!t2) {
+ /* makes no difference which is first, use presentation order */
+ return r1o < r2o;
+ } else {
+ /* r1 is not a track, r2 is, run it early */
+ return false;
+ }
+ }
+
+ if (!t2) {
+ /* we already tested !t1, so just use presentation order */
+ return r1o < r2o;
+ }
+
+ if (t1->rec_enable_control()->get_value()) {
+ if (t2->rec_enable_control()->get_value()) {