+ // Check whether the user wants to export a certain sample range
+ if (sample_range_.first == sample_range_.second) {
+ start_sample_ = 0;
+ sample_count_ = segment->get_sample_count();
+ } else {
+ if (sample_range_.first > sample_range_.second) {
+ start_sample_ = sample_range_.second;
+ sample_count_ = sample_range_.first - sample_range_.second;
+ } else {
+ start_sample_ = sample_range_.first;
+ sample_count_ = sample_range_.second - sample_range_.first;
+ }
+ }
+