+ *start = 0;
+ *end = track->track_duration;
+}
+
+static int64_t calc_samples_pts_duration(MOVMuxContext *mov, MOVTrack *track)
+{
+ int64_t start, end;
+ get_pts_range(mov, track, &start, &end);
+ return end - start;
+}
+
+// Calculate the actual duration of the track, after edits.
+// If it starts with a pts < 0, that is removed by the edit list.
+// If it starts with a pts > 0, the edit list adds a delay before that.
+// Thus, with edit lists enabled, the post-edit output of the file is
+// starting with pts=0.
+static int64_t calc_pts_duration(MOVMuxContext *mov, MOVTrack *track)
+{
+ int64_t start, end;
+ get_pts_range(mov, track, &start, &end);
+ if (mov->use_editlist != 0)
+ start = 0;
+ return end - start;