forked from 0x2620/pandora
dont overlap layers if in[i]==out[i+1] during srt import
This commit is contained in:
parent
da9dd942b2
commit
083051dfc5
1 changed files with 15 additions and 1 deletions
|
@ -89,6 +89,20 @@ pandora.ui.importAnnotations = function(data) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function parseSRT(data) {
|
||||||
|
var srt = Ox.parseSRT(data),
|
||||||
|
length = srt.length - 1;
|
||||||
|
//pandora layers include outpoint,
|
||||||
|
//speedtrans right now sets in to out,
|
||||||
|
//to avoid one frame overlaps,
|
||||||
|
//move outpoint by 0.001 seconds
|
||||||
|
for (var i=0; i < length; i++) {
|
||||||
|
if (srt[i].out == srt[i+1]['in']) {
|
||||||
|
srt[i].out = srt[i].out - 0.001;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return srt;
|
||||||
|
}
|
||||||
content.append($('<div>').css({
|
content.append($('<div>').css({
|
||||||
padding: '4px',
|
padding: '4px',
|
||||||
paddingBottom: '16px'
|
paddingBottom: '16px'
|
||||||
|
@ -118,7 +132,7 @@ pandora.ui.importAnnotations = function(data) {
|
||||||
file = this.files[0];
|
file = this.files[0];
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onloadend = function(event) {
|
reader.onloadend = function(event) {
|
||||||
srt = Ox.parseSRT(this.result);
|
srt = parseSRT(this.result);
|
||||||
total = srt.length;
|
total = srt.length;
|
||||||
total && importButton.options({disabled: false});
|
total && importButton.options({disabled: false});
|
||||||
$status.html(
|
$status.html(
|
||||||
|
|
Loading…
Reference in a new issue