filter invalid srt blocks
This commit is contained in:
parent
c5534df039
commit
bb8ac55513
1 changed files with 2 additions and 2 deletions
|
@ -212,7 +212,7 @@ Ox.parseSRT = function(string, fps) {
|
||||||
var lines = block.split('\n'), points;
|
var lines = block.split('\n'), points;
|
||||||
if (lines.length < 3) {
|
if (lines.length < 3) {
|
||||||
Ox.Log('Core', 'skip invalid srt block', lines);
|
Ox.Log('Core', 'skip invalid srt block', lines);
|
||||||
continue;
|
return {};
|
||||||
}
|
}
|
||||||
lines.shift();
|
lines.shift();
|
||||||
points = lines.shift().split(' --> ').map(function(point) {
|
points = lines.shift().split(' --> ').map(function(point) {
|
||||||
|
@ -232,7 +232,7 @@ Ox.parseSRT = function(string, fps) {
|
||||||
out: points[1],
|
out: points[1],
|
||||||
text: lines.join('\n')
|
text: lines.join('\n')
|
||||||
};
|
};
|
||||||
});
|
}).filter(function(block) { return !Ox.isEmpty(block); });
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
|
|
Loading…
Reference in a new issue