fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / export_format_base.cc
index 92400b5e474f68203fe4f0c5f9b68ed23f3b3186..1eda44991550f3e6267170c3f3718faef8c80fc7 100644 (file)
@@ -70,12 +70,6 @@ ExportFormatBase::get_intersection (ExportFormatBase const & other) const
        return do_set_operation (other, SetIntersection);
 }
 
-boost::shared_ptr<ExportFormatBase>
-ExportFormatBase::get_difference (ExportFormatBase const & other) const
-{
-       return do_set_operation (other, SetDifference);
-}
-
 boost::shared_ptr<ExportFormatBase>
 ExportFormatBase::get_union (ExportFormatBase const & other) const
 {
@@ -101,9 +95,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
                  case SetIntersection:
                        std::set_intersection (start1, end1, start2, end2, insert);
                        break;
-                 case SetDifference:
-                       std::set_difference (start1, end1, start2, end2, insert);
-                       break;
                  case SetUnion:
                        std::set_union (start1, end1, start2, end2, insert);
                        break;
@@ -122,9 +113,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
                  case SetIntersection:
                        std::set_intersection (start1, end1, start2, end2, insert);
                        break;
-                 case SetDifference:
-                       std::set_difference (start1, end1, start2, end2, insert);
-                       break;
                  case SetUnion:
                        std::set_union (start1, end1, start2, end2, insert);
                        break;
@@ -144,9 +132,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
                  case SetIntersection:
                        std::set_intersection (start1, end1, start2, end2, insert);
                        break;
-                 case SetDifference:
-                       std::set_difference (start1, end1, start2, end2, insert);
-                       break;
                  case SetUnion:
                        std::set_union (start1, end1, start2, end2, insert);
                        break;
@@ -165,9 +150,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
                  case SetIntersection:
                        std::set_intersection (start1, end1, start2, end2, insert);
                        break;
-                 case SetDifference:
-                       std::set_difference (start1, end1, start2, end2, insert);
-                       break;
                  case SetUnion:
                        std::set_union (start1, end1, start2, end2, insert);
                        break;
@@ -186,9 +168,6 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
                  case SetIntersection:
                        std::set_intersection (start1, end1, start2, end2, insert);
                        break;
-                 case SetDifference:
-                       std::set_difference (start1, end1, start2, end2, insert);
-                       break;
                  case SetUnion:
                        std::set_union (start1, end1, start2, end2, insert);
                        break;
@@ -206,13 +185,13 @@ ExportFormatBase::nearest_sample_rate (framecnt_t sample_rate)
        SampleRate best_match = SR_None;
 
        #define DO_SR_COMPARISON(rate) \
-       diff = std::abs((rate) - sample_rate); \
+       diff = std::fabs((double)((rate) - sample_rate)); \
        if(diff < smallest_diff) { \
                smallest_diff = diff; \
                best_match = (rate); \
        }
 
-       DO_SR_COMPARISON(SR_22_05);
+       DO_SR_COMPARISON(SR_8);
        DO_SR_COMPARISON(SR_22_05);
        DO_SR_COMPARISON(SR_44_1);
        DO_SR_COMPARISON(SR_48);