Fix loading sessions w/new tempo-map.
authorRobin Gareus <robin@gareus.org>
Sat, 28 Oct 2017 13:44:39 +0000 (15:44 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 28 Oct 2017 13:45:08 +0000 (15:45 +0200)
Newly constructed sessions don't save "Tempo-start" property.
If there's no "start" node, _legacy_bbt is never explicitly set and
the default c'tor is used, which sets bar = 1.
The test for legacy session checks bar != 0.

All new sessions were processed with fix_legacy_session(), which breaks
the tempo-map and makes the session not loadable (duplicate Tempo).

libs/ardour/tempo.cc

index 93e8a90ee5c1b7629bf21e844aedd69a16fcc5a4..ce2d311d391c475aa407395e29e27b119cd72c04 100644 (file)
@@ -162,6 +162,7 @@ TempoSection::TempoSection (const XMLNode& node, samplecnt_t sample_rate)
 {
        BBT_Time bbt;
        std::string start_bbt;
+       _legacy_bbt.bars = 0; // legacy session check compars .bars != 0; default BBT_Time c'tor uses 1.
        if (node.get_property ("start", start_bbt)) {
                if (string_to_bbt_time (start_bbt, bbt)) {
                        /* legacy session - start used to be in bbt*/