Skip to content

Commit

Permalink
Extract subtracks using original speed intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
isdenmois committed Jan 29, 2021
1 parent 7fd7a37 commit d949051
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ private void subTracks(ActionEvent actionEvent) {
}

private void extractSubtracks(MediaInfo mediaInfo, Boolean wrapWithChapters, long interval) {
double speed = ConverterApplication.getContext().getSpeed();
long duration = mediaInfo.getDuration();

if (speed != 1.0) {
interval = (long) (interval * speed);
duration = (long) (duration * speed);
}

long fullTracks = duration / interval;
List<Track> tracks = new ArrayList<>();
for (int i = 1; i <= fullTracks + (duration % interval > 0 ? 1 : 0); i++) {
Expand Down

0 comments on commit d949051

Please sign in to comment.