don't create detected segments twice

in mode 2
fixes #2236
pull/2263/head
Mikael Finstad 2 years ago
parent 6e6256167b
commit 0114faf2d1
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -317,11 +317,15 @@ async function detectIntervals({ filePath, customArgs, onProgress, from, to, mat
start: midpoints[i - 1] ?? 0,
end: time,
},
{
start: time,
end: midpoints[i + 1] ?? (to - from),
},
]);
const lastMidpoint = midpoints.at(-1);
if (lastMidpoint != null) {
segments.push({
start: lastMidpoint,
end: to - from,
});
}
}
return adjustSegmentsWithOffset({ segments, from });

Loading…
Cancel
Save