Skip to content

Instantly share code, notes, and snippets.

@Daiz
Created April 15, 2013 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daiz/5389309 to your computer and use it in GitHub Desktop.
Save Daiz/5389309 to your computer and use it in GitHub Desktop.
for(var i = 0, startFrame = 0, endFrame = 0; i < s; i++) {
startFrame = ((framecount/parts)*i|0);
endFrame = ((framecount/parts)*(i+1)|0) - 1;
trimPoints = trimPoints.concat([startFrame,endFrame]);
console.log(endFrame - startFrame + 1);
}
// sb - startBytes
// eb - endBytes
// parts - number of parts
// ranges - byte ranges array
//
for(var i = 0, sb = 0, eb = 0; i < parts; i++) {
sb = ((dlen/parts)*i|0);
eb = ((dlen/parts)*(i+1)|0) - 1;
ranges = ranges.concat([sb,eb]);
console.log(eb - sb + 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment