Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Properly close the video file if rendering is aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
thenickdude committed Jan 12, 2017
1 parent 99da72c commit d51d402
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/js/flightlog_video_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
that.emit("complete", success, frameCount);
}

function finishRender() {
function finishRender(success) {
var
complete;

Expand All @@ -146,7 +146,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
}

complete.then(function() {
notifyCompletion(true, frameIndex);
notifyCompletion(success, frameIndex);
});
}

Expand All @@ -162,7 +162,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
framesToRender = Math.min(workChunkSize, frameCount - frameIndex);

if (cancel) {
notifyCompletion(false);
finishRender(false);
return;
}

Expand All @@ -171,7 +171,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
that.emit("progress", frameIndex, frameCount, that.getWrittenSize());

if (frameIndex >= frameCount) {
finishRender();
finishRender(true);
} else {
setTimeout(renderChunk, 0);
}
Expand Down

0 comments on commit d51d402

Please sign in to comment.